ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Coro/Event/Event.xs
(Generate patch)

Comparing Coro/Event/Event.xs (file contents):
Revision 1.19 by root, Wed Jan 24 16:22:08 2007 UTC vs.
Revision 1.21 by root, Sat Sep 22 21:10:15 2007 UTC

14#define CD_HITS 3 /* hardcoded in Coro::Event */ 14#define CD_HITS 3 /* hardcoded in Coro::Event */
15#define CD_GOT 4 /* hardcoded in Coro::Event, Coro::Handle */ 15#define CD_GOT 4 /* hardcoded in Coro::Event, Coro::Handle */
16#define CD_MAX 4 16#define CD_MAX 4
17 17
18static HV *coro_event_event_stash; 18static HV *coro_event_event_stash;
19
20#define PERL_MAGIC_coro_event 0x18 /* to avoid clashes with e.g. event */
19 21
20static void 22static void
21coro_std_cb (pe_event *pe) 23coro_std_cb (pe_event *pe)
22{ 24{
23 AV *priv = (AV *)pe->ext_data; 25 AV *priv = (AV *)pe->ext_data;
105 SvREADONLY_on (priv); 107 SvREADONLY_on (priv);
106 108
107 w->callback = coro_std_cb; 109 w->callback = coro_std_cb;
108 w->ext_data = priv; 110 w->ext_data = priv;
109 111
110 /* make sure Event does not use PERL_MAGIC_uvar, which */
111 /* we abuse for non-uvar purposes. */
112 sv_magicext (SvRV (self), newRV_noinc ((SV *)priv), PERL_MAGIC_uvar, 0, 0, 0); 112 sv_magicext (SvRV (self), newRV_noinc ((SV *)priv), PERL_MAGIC_coro_event, 0, w, 0);
113 } 113 }
114} 114}
115 115
116void 116void
117_next (SV *self) 117_next (SV *self)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines