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.276 by root, Sat Nov 15 07:49:48 2008 UTC vs.
Revision 1.277 by root, Sat Nov 15 18:40:55 2008 UTC

811 811
812 return orig_sigelem_set ? orig_sigelem_set (aTHX_ sv, mg) : 0; 812 return orig_sigelem_set ? orig_sigelem_set (aTHX_ sv, mg) : 0;
813} 813}
814 814
815static void 815static void
816prepare_nop (aTHX_ struct coro_transfer_args *ta) 816prepare_nop (pTHX_ struct coro_transfer_args *ta)
817{ 817{
818 /* kind of mega-hacky, but works */ 818 /* kind of mega-hacky, but works */
819 ta->next = ta->prev = (struct coro *)ta; 819 ta->next = ta->prev = (struct coro *)ta;
820} 820}
821 821
822static int 822static int
823slf_check_nop (aTHX) 823slf_check_nop (pTHX_ struct CoroSLF *frame)
824{ 824{
825 return 0; 825 return 0;
826} 826}
827 827
828static void 828static void
1320 dSTACKLEVEL; 1320 dSTACKLEVEL;
1321 1321
1322 /* sometimes transfer is only called to set idle_sp */ 1322 /* sometimes transfer is only called to set idle_sp */
1323 if (expect_false (!next)) 1323 if (expect_false (!next))
1324 { 1324 {
1325 ((coro_cctx *)prev)->idle_sp = stacklevel; 1325 ((coro_cctx *)prev)->idle_sp = (void *)stacklevel;
1326 assert (((coro_cctx *)prev)->idle_te = PL_top_env); /* just for the side-effect when asserts are enabled */ 1326 assert (((coro_cctx *)prev)->idle_te = PL_top_env); /* just for the side-effect when asserts are enabled */
1327 } 1327 }
1328 else if (expect_true (prev != next)) 1328 else if (expect_true (prev != next))
1329 { 1329 {
1330 coro_cctx *prev__cctx; 1330 coro_cctx *prev__cctx;
1357 1357
1358 prev__cctx = prev->cctx; 1358 prev__cctx = prev->cctx;
1359 1359
1360 /* possibly untie and reuse the cctx */ 1360 /* possibly untie and reuse the cctx */
1361 if (expect_true ( 1361 if (expect_true (
1362 prev__cctx->idle_sp == stacklevel 1362 prev__cctx->idle_sp == (void *)stacklevel
1363 && !(prev__cctx->flags & CC_TRACE) 1363 && !(prev__cctx->flags & CC_TRACE)
1364 && !force_cctx 1364 && !force_cctx
1365 )) 1365 ))
1366 { 1366 {
1367 /* I assume that stacklevel is a stronger indicator than PL_top_env changes */ 1367 /* I assume that stacklevel is a stronger indicator than PL_top_env changes */
1862static void 1862static void
1863slf_prepare_transfer (pTHX_ struct coro_transfer_args *ta) 1863slf_prepare_transfer (pTHX_ struct coro_transfer_args *ta)
1864{ 1864{
1865 SV **arg = (SV **)slf_frame.data; 1865 SV **arg = (SV **)slf_frame.data;
1866 1866
1867 prepare_transfer (ta, arg [0], arg [1]); 1867 prepare_transfer (aTHX_ ta, arg [0], arg [1]);
1868} 1868}
1869 1869
1870static void 1870static void
1871slf_init_transfer (pTHX_ struct CoroSLF *frame, SV **arg, int items) 1871slf_init_transfer (pTHX_ struct CoroSLF *frame, SV **arg, int items)
1872{ 1872{
2642MODULE = Coro::State PACKAGE = Coro::AnyEvent 2642MODULE = Coro::State PACKAGE = Coro::AnyEvent
2643 2643
2644BOOT: 2644BOOT:
2645 sv_activity = coro_get_sv (aTHX_ "Coro::AnyEvent::ACTIVITY", TRUE); 2645 sv_activity = coro_get_sv (aTHX_ "Coro::AnyEvent::ACTIVITY", TRUE);
2646 2646
2647SV * 2647void
2648_schedule (...) 2648_schedule (...)
2649 CODE: 2649 CODE:
2650{ 2650{
2651 static int incede; 2651 static int incede;
2652 2652
2717 AvARRAY (av)[0] = AvARRAY (av)[1]; 2717 AvARRAY (av)[0] = AvARRAY (av)[1];
2718 AvARRAY (av)[1] = count_sv; 2718 AvARRAY (av)[1] = count_sv;
2719 cb = av_shift (av); 2719 cb = av_shift (av);
2720 2720
2721 if (SvOBJECT (cb)) 2721 if (SvOBJECT (cb))
2722 api_ready (cb); 2722 api_ready (aTHX_ cb);
2723 else 2723 else
2724 croak ("callbacks not yet supported"); 2724 croak ("callbacks not yet supported");
2725 2725
2726 SvREFCNT_dec (cb); 2726 SvREFCNT_dec (cb);
2727 } 2727 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines