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.236 by root, Sat May 10 17:43:41 2008 UTC vs.
Revision 1.237 by root, Fri May 23 00:27:06 2008 UTC

1383static int 1383static int
1384api_ready (SV *coro_sv) 1384api_ready (SV *coro_sv)
1385{ 1385{
1386 dTHX; 1386 dTHX;
1387 struct coro *coro; 1387 struct coro *coro;
1388 SV *hook; 1388 SV *sv_hook;
1389 void (*xs_hook)(void);
1389 1390
1390 if (SvROK (coro_sv)) 1391 if (SvROK (coro_sv))
1391 coro_sv = SvRV (coro_sv); 1392 coro_sv = SvRV (coro_sv);
1392 1393
1393 coro = SvSTATE (coro_sv); 1394 coro = SvSTATE (coro_sv);
1397 1398
1398 coro->flags |= CF_READY; 1399 coro->flags |= CF_READY;
1399 1400
1400 LOCK; 1401 LOCK;
1401 1402
1402 hook = coro_nready ? 0 : coro_readyhook; 1403 sv_hook = coro_nready ? 0 : coro_readyhook;
1404 xs_hook = coro_nready ? 0 : coroapi.readyhook;
1403 1405
1404 coro_enq (aTHX_ SvREFCNT_inc (coro_sv)); 1406 coro_enq (aTHX_ SvREFCNT_inc (coro_sv));
1405 ++coro_nready; 1407 ++coro_nready;
1406 1408
1407 UNLOCK; 1409 UNLOCK;
1408 1410
1409 if (hook) 1411 if (sv_hook)
1410 { 1412 {
1411 dSP; 1413 dSP;
1412 1414
1413 ENTER; 1415 ENTER;
1414 SAVETMPS; 1416 SAVETMPS;
1415 1417
1416 PUSHMARK (SP); 1418 PUSHMARK (SP);
1417 PUTBACK; 1419 PUTBACK;
1418 call_sv (hook, G_DISCARD); 1420 call_sv (sv_hook, G_DISCARD);
1419 SPAGAIN; 1421 SPAGAIN;
1420 1422
1421 FREETMPS; 1423 FREETMPS;
1422 LEAVE; 1424 LEAVE;
1423 } 1425 }
1426
1427 if (xs_hook)
1428 xs_hook ();
1424 1429
1425 return 1; 1430 return 1;
1426} 1431}
1427 1432
1428static int 1433static int
1614 main_top_env = PL_top_env; 1619 main_top_env = PL_top_env;
1615 1620
1616 while (main_top_env->je_prev) 1621 while (main_top_env->je_prev)
1617 main_top_env = main_top_env->je_prev; 1622 main_top_env = main_top_env->je_prev;
1618 1623
1619 coroapi.ver = CORO_API_VERSION; 1624 coroapi.ver = CORO_API_VERSION;
1620 coroapi.rev = CORO_API_REVISION; 1625 coroapi.rev = CORO_API_REVISION;
1621 coroapi.transfer = api_transfer; 1626 coroapi.transfer = api_transfer;
1622 1627
1623 assert (("PRIO_NORMAL must be 0", !PRIO_NORMAL)); 1628 assert (("PRIO_NORMAL must be 0", !PRIO_NORMAL));
1624} 1629}
1625 1630
1626SV * 1631SV *
2077 2082
2078BOOT: 2083BOOT:
2079 sv_activity = coro_get_sv (aTHX_ "Coro::AnyEvent::ACTIVITY", TRUE); 2084 sv_activity = coro_get_sv (aTHX_ "Coro::AnyEvent::ACTIVITY", TRUE);
2080 2085
2081SV * 2086SV *
2082_schedule () 2087_schedule (...)
2083 PROTOTYPE: @ 2088 PROTOTYPE: @
2084 CODE: 2089 CODE:
2085{ 2090{
2086 static int incede; 2091 static int incede;
2087 2092

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines