Coro::Signal - coroutine signals |
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 signal/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.
timed_wait($timeout)
wait
, but returns false if no signal happens within $timeout
seconds, otherwise true.
Marc Lehmann <pcg@goof.com> http://www.goof.com/pcg/marc/
Coro::Signal - coroutine signals |