ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Coro.pm
(Generate patch)

Comparing Coro/Coro.pm (file contents):
Revision 1.120 by root, Fri Apr 13 03:57:15 2007 UTC vs.
Revision 1.121 by root, Fri Apr 13 12:56:55 2007 UTC

185 185
186Create a new asynchronous coroutine and return it's coroutine object 186Create a new asynchronous coroutine and return it's coroutine object
187(usually unused). When the sub returns the new coroutine is automatically 187(usually unused). When the sub returns the new coroutine is automatically
188terminated. 188terminated.
189 189
190Calling C<exit> in a coroutine will not work correctly, so do not do that. 190Calling C<exit> in a coroutine will try to do the same as calling exit
191outside the coroutine, but this is experimental. It is best not to rely on
192exit doing any cleanups or even not crashing.
191 193
192When the coroutine dies, the program will exit, just as in the main 194When the coroutine dies, the program will exit, just as in the main
193program. 195program.
194 196
195 # create a new coroutine that just prints its arguments 197 # create a new coroutine that just prints its arguments
326Create a new coroutine and return it. When the sub returns the coroutine 328Create a new coroutine and return it. When the sub returns the coroutine
327automatically terminates as if C<terminate> with the returned values were 329automatically terminates as if C<terminate> with the returned values were
328called. To make the coroutine run you must first put it into the ready queue 330called. To make the coroutine run you must first put it into the ready queue
329by calling the ready method. 331by calling the ready method.
330 332
331Calling C<exit> in a coroutine will not work correctly, so do not do that. 333See C<async> for additional discussion.
332 334
333=cut 335=cut
334 336
335sub _run_coro { 337sub _run_coro {
336 terminate &{+shift}; 338 terminate &{+shift};

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines