--- cvsroot/Coro/Coro.pm 2009/11/24 06:13:01 1.272 +++ cvsroot/Coro/Coro.pm 2010/03/31 17:41:07 1.275 @@ -83,7 +83,7 @@ our $main; # main coro our $current; # current coro -our $VERSION = 5.2; +our $VERSION = 5.21; our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub rouse_cb rouse_wait); our %EXPORT_TAGS = ( @@ -140,7 +140,8 @@ =cut -$idle = new Coro sub { +# ||= because other modules could have provided their own by now +$idle ||= new Coro sub { require Coro::Debug; die "FATAL: deadlock detected.\n" . Coro::Debug::ps_listing (); @@ -667,6 +668,10 @@ otherwise you might suffer from crashes or worse. The only event library currently known that is safe to use without C is L. +Coro will try to catch you when you block in the event loop +("FATAL:$Coro::IDLE blocked itself"), but this is just best effort and +only works when you do not run your own event loop. + This function allows your callbacks to block by executing them in another coro where it is safe to block. One example where blocking is handy is when you use the L functions to save results to