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 nothrow

Lazily 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

slotsWatcher slot array.
allocTokenCallback: () => Token to allocate a token.
checkLimitCallback: (LimitKind, size_t current, size_t limit) => bool.
openFdsCallback: () => size_t for current FD count.
maxWatchersMaximum watcher limit.
maxFdsMaximum FD limit.
updateFdsCallback: (long delta) => void.
setCallbackCallback: (ref Slot) => void to set the wakeup callback.
registrationSeqReference to registration sequence counter.
watcherCountReference to watcher count.