… | |
… | |
2248 | slf_init_terminate_cancel_common (aTHX_ frame, coro_hv); |
2248 | slf_init_terminate_cancel_common (aTHX_ frame, coro_hv); |
2249 | } |
2249 | } |
2250 | else |
2250 | else |
2251 | { |
2251 | { |
2252 | struct coro *self = SvSTATE_current; |
2252 | struct coro *self = SvSTATE_current; |
|
|
2253 | |
|
|
2254 | if (!self) |
|
|
2255 | croak ("Coro::cancel called outside of thread content,"); |
2253 | |
2256 | |
2254 | /* otherwise we cancel directly, purely for speed reasons |
2257 | /* otherwise we cancel directly, purely for speed reasons |
2255 | * unfortunately, this requires some magic trickery, as |
2258 | * unfortunately, this requires some magic trickery, as |
2256 | * somebody else could cancel us, so we have to fight the cancellation. |
2259 | * somebody else could cancel us, so we have to fight the cancellation. |
2257 | * this is ugly, and hopefully fully worth the extra speed. |
2260 | * this is ugly, and hopefully fully worth the extra speed. |
… | |
… | |
3442 | |
3445 | |
3443 | PROTOTYPES: DISABLE |
3446 | PROTOTYPES: DISABLE |
3444 | |
3447 | |
3445 | BOOT: |
3448 | BOOT: |
3446 | { |
3449 | { |
|
|
3450 | #define VARx(name,expr,type) if (sizeof (type) < sizeof (expr)) croak ("FATAL: Coro thread context slot '" # name "' too small for this version of perl."); |
|
|
3451 | #include "state.h" |
3447 | #ifdef USE_ITHREADS |
3452 | #ifdef USE_ITHREADS |
3448 | # if CORO_PTHREAD |
3453 | # if CORO_PTHREAD |
3449 | coro_thx = PERL_GET_CONTEXT; |
3454 | coro_thx = PERL_GET_CONTEXT; |
3450 | # endif |
3455 | # endif |
3451 | #endif |
3456 | #endif |