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.71 by root, Wed Jan 25 21:43:58 2006 UTC vs.
Revision 1.74 by root, Mon Oct 23 22:49:09 2006 UTC

346 PL_scopestack_ix = c->scopestack_ix; 346 PL_scopestack_ix = c->scopestack_ix;
347 PL_scopestack_max = c->scopestack_max; 347 PL_scopestack_max = c->scopestack_max;
348 PL_savestack = c->savestack; 348 PL_savestack = c->savestack;
349 PL_savestack_ix = c->savestack_ix; 349 PL_savestack_ix = c->savestack_ix;
350 PL_savestack_max = c->savestack_max; 350 PL_savestack_max = c->savestack_max;
351#ifdef PL_retstack 351#if PERL_VERSION < 9
352 PL_retstack = c->retstack; 352 PL_retstack = c->retstack;
353 PL_retstack_ix = c->retstack_ix; 353 PL_retstack_ix = c->retstack_ix;
354 PL_retstack_max = c->retstack_max; 354 PL_retstack_max = c->retstack_max;
355#endif 355#endif
356 PL_curpm = c->curpm; 356 PL_curpm = c->curpm;
474 c->scopestack_ix = PL_scopestack_ix; 474 c->scopestack_ix = PL_scopestack_ix;
475 c->scopestack_max = PL_scopestack_max; 475 c->scopestack_max = PL_scopestack_max;
476 c->savestack = PL_savestack; 476 c->savestack = PL_savestack;
477 c->savestack_ix = PL_savestack_ix; 477 c->savestack_ix = PL_savestack_ix;
478 c->savestack_max = PL_savestack_max; 478 c->savestack_max = PL_savestack_max;
479#ifdef PL_retstack 479#if PERL_VERSION < 9
480 c->retstack = PL_retstack; 480 c->retstack = PL_retstack;
481 c->retstack_ix = PL_retstack_ix; 481 c->retstack_ix = PL_retstack_ix;
482 c->retstack_max = PL_retstack_max; 482 c->retstack_max = PL_retstack_max;
483#endif 483#endif
484 c->curpm = PL_curpm; 484 c->curpm = PL_curpm;
525 525
526 New(54,PL_savestack,96,ANY); 526 New(54,PL_savestack,96,ANY);
527 PL_savestack_ix = 0; 527 PL_savestack_ix = 0;
528 PL_savestack_max = 96; 528 PL_savestack_max = 96;
529 529
530#ifdef PL_retstack 530#if PERL_VERSION < 9
531 New(54,PL_retstack,8,OP*); 531 New(54,PL_retstack,8,OP*);
532 PL_retstack_ix = 0; 532 PL_retstack_ix = 0;
533 PL_retstack_max = 8; 533 PL_retstack_max = 8;
534#endif 534#endif
535 535
579 579
580 Safefree (PL_tmps_stack); 580 Safefree (PL_tmps_stack);
581 Safefree (PL_markstack); 581 Safefree (PL_markstack);
582 Safefree (PL_scopestack); 582 Safefree (PL_scopestack);
583 Safefree (PL_savestack); 583 Safefree (PL_savestack);
584#ifdef PL_retstack 584#if PERL_VERSION < 9
585 Safefree (PL_retstack); 585 Safefree (PL_retstack);
586#endif 586#endif
587} 587}
588 588
589static void 589static void
867static int coro_nready; 867static int coro_nready;
868 868
869static void 869static void
870coro_enq (pTHX_ SV *sv) 870coro_enq (pTHX_ SV *sv)
871{ 871{
872 SV **xprio;
873 int prio;
874
872 if (SvTYPE (sv) == SVt_PVHV) 875 if (SvTYPE (sv) != SVt_PVHV)
873 {
874 SV **xprio = hv_fetch ((HV *)sv, "prio", 4, 0);
875 int prio = xprio ? SvIV (*xprio) : PRIO_NORMAL;
876
877 prio = prio > PRIO_MAX ? PRIO_MAX
878 : prio < PRIO_MIN ? PRIO_MIN
879 : prio;
880
881 av_push (coro_ready [prio - PRIO_MIN], sv);
882 coro_nready++;
883
884 return;
885 }
886
887 croak ("Coro::ready tried to enqueue something that is not a coroutine"); 876 croak ("Coro::ready tried to enqueue something that is not a coroutine");
877
878 xprio = hv_fetch ((HV *)sv, "prio", 4, 0);
879 prio = xprio ? SvIV (*xprio) : PRIO_NORMAL;
880
881 prio = prio > PRIO_MAX ? PRIO_MAX
882 : prio < PRIO_MIN ? PRIO_MIN
883 : prio;
884
885 av_push (coro_ready [prio - PRIO_MIN], sv);
886 coro_nready++;
888} 887}
889 888
890static SV * 889static SV *
891coro_deq (pTHX_ int min_prio) 890coro_deq (pTHX_ int min_prio)
892{ 891{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines