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.436 by root, Tue Nov 5 14:38:46 2013 UTC vs.
Revision 1.439 by root, Tue Nov 19 05:16:01 2013 UTC

42# define PadARRAY AvARRAY 42# define PadARRAY AvARRAY
43# define PadMAX AvFILLp 43# define PadMAX AvFILLp
44# define newPADLIST(var) ((var) = newAV (), av_extend (var, 1)) 44# define newPADLIST(var) ((var) = newAV (), av_extend (var, 1))
45#endif 45#endif
46 46
47/* 5.19.something has replaced SVt_BIND by SVt_INVLIST */
48/* we just alias it to SVt_IV, as that is sufficient for swap_sv for now */
49#if PERL_VERSION_ATLEAST(5,19,0)
50# define SVt_BIND SVt_IV
51#endif
52
47#if defined(_WIN32) 53#if defined(_WIN32)
48# undef HAS_GETTIMEOFDAY 54# undef HAS_GETTIMEOFDAY
49# undef setjmp 55# undef setjmp
50# undef longjmp 56# undef longjmp
51# undef _exit 57# undef _exit
564 570
565 while (i > 0) /* special-case index 0 */ 571 while (i > 0) /* special-case index 0 */
566 { 572 {
567 /* we try to be extra-careful here */ 573 /* we try to be extra-careful here */
568 PAD *pad = PadlistARRAY (padlist)[i--]; 574 PAD *pad = PadlistARRAY (padlist)[i--];
575
576 if (pad)
577 {
569 I32 j = PadMAX (pad); 578 I32 j = PadMAX (pad);
570 579
571 while (j >= 0) 580 while (j >= 0)
572 SvREFCNT_dec (PadARRAY (pad)[j--]); 581 SvREFCNT_dec (PadARRAY (pad)[j--]);
573 582
574 PadMAX (pad) = -1; 583 PadMAX (pad) = -1;
575 SvREFCNT_dec (pad); 584 SvREFCNT_dec (pad);
585 }
576 } 586 }
577 587
578 SvREFCNT_dec (PadlistNAMES (padlist)); 588 SvREFCNT_dec (PadlistNAMES (padlist));
579 589
580#if NEWPADAPI 590#if NEWPADAPI
1906 /* nothing to schedule: call the idle handler */ 1916 /* nothing to schedule: call the idle handler */
1907 if (SvROK (sv_idle) 1917 if (SvROK (sv_idle)
1908 && SvOBJECT (SvRV (sv_idle))) 1918 && SvOBJECT (SvRV (sv_idle)))
1909 { 1919 {
1910 if (SvRV (sv_idle) == SvRV (coro_current)) 1920 if (SvRV (sv_idle) == SvRV (coro_current))
1921 {
1922 require_pv ("Carp");
1923
1924 {
1925 dSP;
1926
1927 ENTER;
1928 SAVETMPS;
1929
1930 PUSHMARK (SP);
1911 croak ("FATAL: $Coro::IDLE blocked itself - did you try to block inside an event loop callback? Caught"); 1931 XPUSHs (sv_2mortal (newSVpv ("FATAL: $Coro::IDLE blocked itself - did you try to block inside an event loop callback? Caught", 0)));
1932 PUTBACK;
1933 call_pv ("Carp::confess", G_VOID | G_DISCARD);
1934
1935 FREETMPS;
1936 LEAVE;
1937 }
1938 }
1912 1939
1913 ++coro_nready; /* hack so that api_ready doesn't invoke ready hook */ 1940 ++coro_nready; /* hack so that api_ready doesn't invoke ready hook */
1914 api_ready (aTHX_ SvRV (sv_idle)); 1941 api_ready (aTHX_ SvRV (sv_idle));
1915 --coro_nready; 1942 --coro_nready;
1916 } 1943 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines