The gate API is the same as for condition variables. However, their semantics differ: - when a thread waits on a gate, it blocks unconditionally. - when a thread signals a gate, all the threads blocked on this gate are unblocked. - atomicity of unlocking and waiting on the gate is ensured, so that no signal is "lost". On the other hand, gate signals without blocking threads are ignored. It is important that the waiting threads check their external condition (in its mutex) in a loop with the gate-wait call, if that external condition can be modified by waiting threads previously unblocked.
GATE-NAME
GATE-SIGNAL
GATE-WAIT
MAKE-GATE