--- Coro/Coro.pm 2006/12/04 03:48:16 1.96 +++ Coro/Coro.pm 2006/12/04 13:47:56 1.97 @@ -49,7 +49,7 @@ our %EXPORT_TAGS = ( prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], ); -our @EXPORT_OK = @{$EXPORT_TAGS{prio}}; +our @EXPORT_OK = (@{$EXPORT_TAGS{prio}}, qw(nready)); { my @async; @@ -350,10 +350,18 @@ =back -=head2 UTILITY FUNCTIONS +=head2 GLOBAL FUNCTIONS =over 4 +=item Coro::nready + +Returns the number of coroutines that are currently in the ready state, +i.e. that can be swicthed to. The value C<0> means that the only runnable +coroutine is the currently running one, so C would have no effect, +and C would cause a deadlock unless there is an idle handler +that wakes up some coroutines. + =item unblock_sub { ... } This utility function takes a BLOCK or code reference and "unblocks" it,