Wait for contition.
This function makes the current thread sleep until the condition
variable is signalled. The argument should be a Thread.MutexKey
object for a Thread.Mutex . It will be unlocked atomically
before waiting for the signal and then relocked atomically when
the signal is received.
The thread that sends the signal should have the mutex locked
while sending it. Otherwise it's impossible to avoid races where
signals are sent while the listener(s) haven't arrived to the
wait calls yet.