Coro::Signal - coroutine signals (binary semaphores)
use Coro::Signal; $sig = new Coro::Signal; $sig->wait; # wait for signal # ... some other "thread" $sig->send;
This module implements signals/binary semaphores/condition variables (basically all the same thing). You can wait for a signal to occur or send it, in which case it will wake up one waiter, or it can be broadcast, waking up all waiters.
It is recommended not to mix send
and broadcast
calls on the same
Coro::Signal
- it should work as documented, but it can easily confuse
you :->
send
or broadcast
). Returns
immediately if the signal has been sent before.
Return true when the signal is being awaited by some process.
Marc Lehmann <schmorp@schmorp.de> http://home.schmorp.de/