--- Coro/README 2011/06/29 17:58:52 1.30 +++ Coro/README 2012/12/07 23:23:15 1.31 @@ -318,7 +318,7 @@ GLOBAL VARIABLES $Coro::main This variable stores the Coro object that represents the main - program. While you cna "ready" it and do most other things you can + program. While you can "ready" it and do most other things you can do to coro, it is mainly useful to compare again $Coro::current, to see whether you are running in the main program or not. @@ -792,7 +792,7 @@ This method simply sets the "$coro->{desc}" member to the given string. You can modify this member directly if you wish, and in fact, this is often preferred to indicate major processing states - that cna then be seen for example in a Coro::Debug session: + that can then be seen for example in a Coro::Debug session: sub my_long_function { local $Coro::current->{desc} = "now in my_long_function"; @@ -916,7 +916,7 @@ } In the case where "rouse_cb" and "rouse_wait" are not flexible enough, - you can roll your own, using "schedule": + you can roll your own, using "schedule" and "ready": sub wait_for_child($) { my ($pid) = @_; @@ -929,7 +929,8 @@ # pass a closure to ->child my $watcher = AnyEvent->child (pid => $pid, cb => sub { $rstatus = $_[1]; # remember rstatus - $done = 1; # mark $rstatus as valud + $done = 1; # mark $rstatus as valid + $current->ready; # wake up the waiting thread }); # wait until the closure has been called