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

Comparing Coro/Coro/State.xs (file contents):
Revision 1.343 by root, Mon Dec 15 16:41:43 2008 UTC vs.
Revision 1.344 by root, Mon Dec 15 19:39:40 2008 UTC

1484coro_state_destroy (pTHX_ struct coro *coro) 1484coro_state_destroy (pTHX_ struct coro *coro)
1485{ 1485{
1486 if (coro->flags & CF_DESTROYED) 1486 if (coro->flags & CF_DESTROYED)
1487 return 0; 1487 return 0;
1488 1488
1489 if (coro->on_destroy) 1489 if (coro->on_destroy && !PL_dirty)
1490 coro->on_destroy (aTHX_ coro); 1490 coro->on_destroy (aTHX_ coro);
1491 1491
1492 coro->flags |= CF_DESTROYED; 1492 coro->flags |= CF_DESTROYED;
1493 1493
1494 if (coro->flags & CF_READY) 1494 if (coro->flags & CF_READY)
3510 for (i = 1; i <= wcount; ++i) 3510 for (i = 1; i <= wcount; ++i)
3511 PUSHs (sv_2mortal (newRV_inc (AvARRAY (av)[i]))); 3511 PUSHs (sv_2mortal (newRV_inc (AvARRAY (av)[i])));
3512 } 3512 }
3513} 3513}
3514 3514
3515MODULE = Coro::State PACKAGE = Coro::SemaphoreSet
3516
3517void
3518_may_delete (SV *sem, int count, int extra_refs)
3519 PPCODE:
3520{
3521 AV *av = (AV *)SvRV (sem);
3522
3523 if (SvREFCNT ((SV *)av) == 1 + extra_refs
3524 && AvFILLp (av) == 0 /* no waiters, just count */
3525 && SvIV (AvARRAY (av)[0]) == count)
3526 XSRETURN_YES;
3527
3528 XSRETURN_NO;
3529}
3530
3515MODULE = Coro::State PACKAGE = Coro::Signal 3531MODULE = Coro::State PACKAGE = Coro::Signal
3516 3532
3517SV * 3533SV *
3518new (SV *klass) 3534new (SV *klass)
3519 CODE: 3535 CODE:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines