PostState.ensurePostWakeup
void ensurePostWakeup(Slot, AllocFn, CheckFn, UpdateFdsFn, SetCbFn)(
scope Slot[] slots,
scope AllocFn allocToken,
scope CheckFn checkLimit,
scope UpdateFdsFn updateFds,
scope SetCbFn setCallback,
ref ulong registrationSeq,
ref size_t watcherCount,
size_t maxWatchers,
size_t openFds,
size_t maxFds) @trusted nothrowLazily create the post wakeup handle and register a watcher slot.
Allocates a mutex, creates a wakeup handle, checks resource limits, allocates a watcher token, and fills the slot. The caller provides callbacks for platform-specific operations (token allocation, limit checking, fd tracking).
Parameters
slots | Watcher slot array. |
allocToken | Callback: () => Token to allocate a token. |
checkLimit | Callback: (LimitKind, size_t current, size_t limit) => bool. |
openFds | Callback: () => size_t for current FD count. |
maxWatchers | Maximum watcher limit. |
maxFds | Maximum FD limit. |
updateFds | Callback: (long delta) => void. |
setCallback | Callback: (ref Slot) => void to set the wakeup callback. |
registrationSeq | Reference to registration sequence counter. |
watcherCount | Reference to watcher count. |