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.453 by root, Tue Jul 7 00:33:25 2015 UTC vs.
Revision 1.456 by root, Sun Mar 6 06:26:21 2016 UTC

140 140
141static GV *irsgv; /* $/ */ 141static GV *irsgv; /* $/ */
142static GV *stdoutgv; /* *STDOUT */ 142static GV *stdoutgv; /* *STDOUT */
143static SV *rv_diehook; 143static SV *rv_diehook;
144static SV *rv_warnhook; 144static SV *rv_warnhook;
145static HV *hv_sig; /* %SIG */
146 145
147/* async_pool helper stuff */ 146/* async_pool helper stuff */
148static SV *sv_pool_rss; 147static SV *sv_pool_rss;
149static SV *sv_pool_size; 148static SV *sv_pool_size;
150static SV *sv_async_pool_idle; /* description string */ 149static SV *sv_async_pool_idle; /* description string */
710 709
711 /* if SvANY points to the head, we need to adjust the pointers, 710 /* if SvANY points to the head, we need to adjust the pointers,
712 * as the pointer for a still points to b, and maybe vice versa. 711 * as the pointer for a still points to b, and maybe vice versa.
713 */ 712 */
714 U32 svany_in_head_set = (1 << SVt_NULL) | (1 << SVt_BIND) | (1 << SVt_IV) | (1 << SVt_RV); 713 U32 svany_in_head_set = (1 << SVt_NULL) | (1 << SVt_BIND) | (1 << SVt_IV) | (1 << SVt_RV);
715 #if NVSIZE <= IVSIZE && PERL_VERSION_ATLEAST(5,20,0) 714 #if NVSIZE <= IVSIZE && PERL_VERSION_ATLEAST(5,22,0)
716 svany_in_head_set |= 1 << SVt_NV; 715 svany_in_head_set |= 1 << SVt_NV;
717 #endif 716 #endif
718 717
719 #define svany_in_head(type) (svany_in_head_set & (1 << (type))) 718 #define svany_in_head(type) (svany_in_head_set & (1 << (type)))
720 719
3604 3603
3605 orig_sigelem_get = PL_vtbl_sigelem.svt_get; PL_vtbl_sigelem.svt_get = coro_sigelem_get; 3604 orig_sigelem_get = PL_vtbl_sigelem.svt_get; PL_vtbl_sigelem.svt_get = coro_sigelem_get;
3606 orig_sigelem_set = PL_vtbl_sigelem.svt_set; PL_vtbl_sigelem.svt_set = coro_sigelem_set; 3605 orig_sigelem_set = PL_vtbl_sigelem.svt_set; PL_vtbl_sigelem.svt_set = coro_sigelem_set;
3607 orig_sigelem_clr = PL_vtbl_sigelem.svt_clear; PL_vtbl_sigelem.svt_clear = coro_sigelem_clr; 3606 orig_sigelem_clr = PL_vtbl_sigelem.svt_clear; PL_vtbl_sigelem.svt_clear = coro_sigelem_clr;
3608 3607
3609 hv_sig = coro_get_hv (aTHX_ "SIG", TRUE);
3610 rv_diehook = newRV_inc ((SV *)gv_fetchpv ("Coro::State::diehook" , 0, SVt_PVCV)); 3608 rv_diehook = newRV_inc ((SV *)gv_fetchpv ("Coro::State::diehook" , 0, SVt_PVCV));
3611 rv_warnhook = newRV_inc ((SV *)gv_fetchpv ("Coro::State::warnhook", 0, SVt_PVCV)); 3609 rv_warnhook = newRV_inc ((SV *)gv_fetchpv ("Coro::State::warnhook", 0, SVt_PVCV));
3612 3610
3613 coro_state_stash = gv_stashpv ("Coro::State", TRUE); 3611 coro_state_stash = gv_stashpv ("Coro::State", TRUE);
3614 3612
4259 RETVAL = newSVsv (AvARRAY ((AV *)SvRV (self))[0]); 4257 RETVAL = newSVsv (AvARRAY ((AV *)SvRV (self))[0]);
4260 OUTPUT: 4258 OUTPUT:
4261 RETVAL 4259 RETVAL
4262 4260
4263void 4261void
4264up (SV *self, int adjust = 1) 4262up (SV *self)
4265 ALIAS:
4266 adjust = 1
4267 CODE: 4263 CODE:
4264 coro_semaphore_adjust (aTHX_ (AV *)SvRV (self), 1);
4265
4266void
4267adjust (SV *self, int adjust)
4268 CODE:
4268 coro_semaphore_adjust (aTHX_ (AV *)SvRV (self), ix ? adjust : 1); 4269 coro_semaphore_adjust (aTHX_ (AV *)SvRV (self), adjust);
4269 4270
4270void 4271void
4271down (...) 4272down (...)
4272 CODE: 4273 CODE:
4273 CORO_EXECUTE_SLF_XS (slf_init_semaphore_down); 4274 CORO_EXECUTE_SLF_XS (slf_init_semaphore_down);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines