Queues the caller until the signal is placed into a signaled state.
A Promise that will be resolved when the signal is placed into a signaled state.
Places the signal into a blocked (unsignaled) state. This begins queueing any future callers.
NOTE: You often won't need to call this method directly since this signal will reset automatically each time it is set.
Places the signal into a signaled state. This will release only 1 queued caller and then immediately reset the signal.
Releases 1 queued caller each time it is signaled.
The auto reset signal can be used to create a
critical section
-- i.e. a block of code that can only be executed by 1 caller at a time. Every other caller will be queued in the order they arrive, and the next caller in the queue will only be allowed to enter the critical section when the previous caller leaves the critical section.