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.214 by root, Sat Oct 13 23:19:10 2007 UTC vs.
Revision 1.215 by root, Sun Oct 14 19:34:09 2007 UTC

664 return rss; 664 return rss;
665} 665}
666 666
667/** coroutine stack handling ************************************************/ 667/** coroutine stack handling ************************************************/
668 668
669#if 0
669static int (*orig_sigelem_get) (pTHX_ SV *sv, MAGIC *mg); 670static int (*orig_sigelem_get) (pTHX_ SV *sv, MAGIC *mg);
670 671
671/* 672/*
672 * This overrides the default magic get method of %SIG elements. 673 * This overrides the default magic get method of %SIG elements.
673 * The original one doesn't provide for reading back of PL_diehook/PL_warnhook 674 * The original one doesn't provide for reading back of PL_diehook/PL_warnhook
678 * when a schedule happens then, but we ignore this. 679 * when a schedule happens then, but we ignore this.
679 */ 680 */
680static int 681static int
681coro_sigelem_get (pTHX_ SV *sv, MAGIC *mg) 682coro_sigelem_get (pTHX_ SV *sv, MAGIC *mg)
682{ 683{
684 return orig_sigelem_get (aTHX_ sv, mg);
683 const char *s = MgPV_nolen_const (mg); 685 const char *s = MgPV_nolen_const (mg);
684 686
685 if (*s == '_') 687 if (*s == '_')
686 { 688 {
687 if (strEQ (s, "__DIE__" ) && PL_diehook ) return sv_setsv (sv, PL_diehook ), 0; 689 if (strEQ (s, "__DIE__" ) && PL_diehook ) return sv_setsv (sv, PL_diehook ), 0;
688 if (strEQ (s, "__WARN__") && PL_warnhook) return sv_setsv (sv, PL_warnhook), 0; 690 if (strEQ (s, "__WARN__") && PL_warnhook) return sv_setsv (sv, PL_warnhook), 0;
689 } 691 }
690 692
691 return orig_sigelem_get (aTHX_ sv, mg); 693 return orig_sigelem_get (aTHX_ sv, mg);
692} 694}
695#endif
693 696
694static void 697static void
695coro_setup (pTHX_ struct coro *coro) 698coro_setup (pTHX_ struct coro *coro)
696{ 699{
697 /* 700 /*
1530#endif 1533#endif
1531 BOOT_PAGESIZE; 1534 BOOT_PAGESIZE;
1532 1535
1533 irsgv = gv_fetchpv ("/" , GV_ADD|GV_NOTQUAL, SVt_PV); 1536 irsgv = gv_fetchpv ("/" , GV_ADD|GV_NOTQUAL, SVt_PV);
1534 stdoutgv = gv_fetchpv ("STDOUT", GV_ADD|GV_NOTQUAL, SVt_PVIO); 1537 stdoutgv = gv_fetchpv ("STDOUT", GV_ADD|GV_NOTQUAL, SVt_PVIO);
1535 1538#if 0
1536 orig_sigelem_get = PL_vtbl_sigelem.svt_get; 1539 orig_sigelem_get = PL_vtbl_sigelem.svt_get;
1537 PL_vtbl_sigelem.svt_get = coro_sigelem_get; 1540 PL_vtbl_sigelem.svt_get = coro_sigelem_get;
1538 1541#endif
1539 hv_sig = coro_get_hv (aTHX_ "SIG", TRUE); 1542 hv_sig = coro_get_hv (aTHX_ "SIG", TRUE);
1540 rv_diehook = newRV_inc ((SV *)gv_fetchpv ("Coro::State::diehook" , 0, SVt_PVCV)); 1543 rv_diehook = SvREFCNT_inc ((SV *)gv_fetchpv ("Coro::State::diehook" , 0, SVt_PVCV));
1541 rv_warnhook = newRV_inc ((SV *)gv_fetchpv ("Coro::State::warnhook", 0, SVt_PVCV)); 1544 rv_warnhook = SvREFCNT_inc ((SV *)gv_fetchpv ("Coro::State::warnhook", 0, SVt_PVCV));
1542 1545
1543 coro_state_stash = gv_stashpv ("Coro::State", TRUE); 1546 coro_state_stash = gv_stashpv ("Coro::State", TRUE);
1544 1547
1545 newCONSTSUB (coro_state_stash, "CC_TRACE" , newSViv (CC_TRACE)); 1548 newCONSTSUB (coro_state_stash, "CC_TRACE" , newSViv (CC_TRACE));
1546 newCONSTSUB (coro_state_stash, "CC_TRACE_SUB" , newSViv (CC_TRACE_SUB)); 1549 newCONSTSUB (coro_state_stash, "CC_TRACE_SUB" , newSViv (CC_TRACE_SUB));

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines