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.440 by root, Sat Feb 22 14:12:45 2014 UTC vs.
Revision 1.441 by root, Tue Mar 4 05:07:44 2014 UTC

2599 2599
2600/* "undo"/cancel a running slf call - used when cancelling a coro, mainly */ 2600/* "undo"/cancel a running slf call - used when cancelling a coro, mainly */
2601static void 2601static void
2602slf_destroy (pTHX_ struct coro *coro) 2602slf_destroy (pTHX_ struct coro *coro)
2603{ 2603{
2604 /* this callback is reserved for slf functions needing to do cleanup */ 2604 struct CoroSLF frame = coro->slf_frame;
2605 if (coro->slf_frame.destroy && coro->slf_frame.prepare && !PL_dirty)
2606 coro->slf_frame.destroy (aTHX_ &coro->slf_frame);
2607 2605
2608 /* 2606 /*
2609 * The on_destroy above most likely is from an SLF call. 2607 * The on_destroy below most likely is from an SLF call.
2610 * Since by definition the SLF call will not finish when we destroy 2608 * Since by definition the SLF call will not finish when we destroy
2611 * the coro, we will have to force-finish it here, otherwise 2609 * the coro, we will have to force-finish it here, otherwise
2612 * cleanup functions cannot call SLF functions. 2610 * cleanup functions cannot call SLF functions.
2613 */ 2611 */
2614 coro->slf_frame.prepare = 0; 2612 coro->slf_frame.prepare = 0;
2613 coro->slf_frame.destroy = 0;
2614
2615 /* this callback is reserved for slf functions needing to do cleanup */
2616 if (frame.destroy && frame.prepare && !PL_dirty)
2617 frame.destroy (aTHX_ &frame);
2615} 2618}
2616 2619
2617/* 2620/*
2618 * these not obviously related functions are all rolled into one 2621 * these not obviously related functions are all rolled into one
2619 * function to increase chances that they all will call transfer with the same 2622 * function to increase chances that they all will call transfer with the same

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines