--- Coro/Coro/State.xs 2008/10/30 09:44:31 1.251 +++ Coro/Coro/State.xs 2008/11/04 12:08:44 1.252 @@ -169,7 +169,7 @@ static AV *main_mainstack; /* used to differentiate between $main and others */ static JMPENV *main_top_env; static HV *coro_state_stash, *coro_stash; -static volatile SV *coro_mortal; /* will be freed after next transfer */ +static volatile SV *coro_mortal; /* will be freed/thrown after next transfer */ static GV *irsgv; /* $/ */ static GV *stdoutgv; /* *STDOUT */ @@ -1210,7 +1210,6 @@ transfer (pTHX_ struct coro *prev, struct coro *next, int force_cctx) { dSTACKLEVEL; - static volatile int has_throw; /* sometimes transfer is only called to set idle_sp */ if (expect_false (!next)) @@ -1220,6 +1219,7 @@ } else if (expect_true (prev != next)) { + static volatile int has_throw; coro_cctx *prev__cctx; if (expect_false (prev->flags & CF_NEW)) @@ -1836,7 +1836,7 @@ case 1: if (items != 2) - croak ("Coro::State::transfer (prev,next) expects two arguments, not %d", items); + croak ("Coro::State::transfer (prev, next) expects two arguments, not %d", items); prepare_transfer (aTHX_ &ta, ST (0), ST (1)); break; @@ -2009,13 +2009,6 @@ coro->cctx->idle_sp = 0; void -throw (Coro::State self, SV *throw = &PL_sv_undef) - PROTOTYPE: $;$ - CODE: - SvREFCNT_dec (self->throw); - self->throw = SvOK (throw) ? newSVsv (throw) : 0; - -void swap_defsv (Coro::State self) PROTOTYPE: $ ALIAS: @@ -2128,6 +2121,13 @@ OUTPUT: RETVAL +void +throw (Coro::State self, SV *throw = &PL_sv_undef) + PROTOTYPE: $;$ + CODE: + SvREFCNT_dec (self->throw); + self->throw = SvOK (throw) ? newSVsv (throw) : 0; + # for async_pool speedup void _pool_1 (SV *cb)