… | |
… | |
342 | |
342 | |
343 | our $idle; # idle handler |
343 | our $idle; # idle handler |
344 | our $main; # main coro |
344 | our $main; # main coro |
345 | our $current; # current coro |
345 | our $current; # current coro |
346 | |
346 | |
347 | our $VERSION = 5.372; |
347 | our $VERSION = 6.08; |
348 | |
348 | |
349 | our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub rouse_cb rouse_wait); |
349 | our @EXPORT = qw(async async_pool cede schedule terminate current unblock_sub rouse_cb rouse_wait); |
350 | our %EXPORT_TAGS = ( |
350 | our %EXPORT_TAGS = ( |
351 | prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], |
351 | prio => [qw(PRIO_MAX PRIO_HIGH PRIO_NORMAL PRIO_LOW PRIO_IDLE PRIO_MIN)], |
352 | ); |
352 | ); |
… | |
… | |
766 | current Coro. |
766 | current Coro. |
767 | |
767 | |
768 | This is a rather brutal way to free a coro, with some limitations - if |
768 | This is a rather brutal way to free a coro, with some limitations - if |
769 | the thread is inside a C callback that doesn't expect to be canceled, |
769 | the thread is inside a C callback that doesn't expect to be canceled, |
770 | bad things can happen, or if the cancelled thread insists on running |
770 | bad things can happen, or if the cancelled thread insists on running |
771 | complicated cleanup handlers that rely on it'S thread context, things will |
771 | complicated cleanup handlers that rely on its thread context, things will |
772 | not work. |
772 | not work. |
773 | |
773 | |
774 | Any cleanup code being run (e.g. from C<guard> blocks) will be run without |
774 | Any cleanup code being run (e.g. from C<guard> blocks) will be run without |
775 | a thread context, and is not allowed to switch to other threads. On the |
775 | a thread context, and is not allowed to switch to other threads. On the |
776 | plus side, C<< ->cancel >> will always clean up the thread, no matter |
776 | plus side, C<< ->cancel >> will always clean up the thread, no matter |