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

Comparing EV/EV.xs (file contents):
Revision 1.167 by root, Tue Oct 22 10:43:05 2013 UTC vs.
Revision 1.170 by root, Mon Jul 13 05:36:15 2015 UTC

37# define fd_mask Perl_fd_mask 37# define fd_mask Perl_fd_mask
38#endif 38#endif
39/* due to bugs in OS X we have to use libev/ explicitly here */ 39/* due to bugs in OS X we have to use libev/ explicitly here */
40#include "libev/ev.c" 40#include "libev/ev.c"
41 41
42#if !defined _WIN32 && !defined _MINIX 42#if !defined _WIN32 && !defined _MINIX && !EV_NO_ATFORK
43# include <pthread.h> 43# include <pthread.h>
44#endif 44#endif
45 45
46#define e_loop(w) INT2PTR (struct ev_loop *, SvIVX (((ev_watcher *)(w))->loop)) 46#define e_loop(w) INT2PTR (struct ev_loop *, SvIVX (((ev_watcher *)(w))->loop))
47#define e_flags(w) ((ev_watcher *)(w))->e_flags 47#define e_flags(w) ((ev_watcher *)(w))->e_flags
533 evapi.invoke = ev_invoke; 533 evapi.invoke = ev_invoke;
534 534
535 sv_setiv (sv, (IV)&evapi); 535 sv_setiv (sv, (IV)&evapi);
536 SvREADONLY_on (sv); 536 SvREADONLY_on (sv);
537 } 537 }
538#if !defined _WIN32 && !defined _MINIX 538#if !defined _WIN32 && !defined _MINIX && !EV_NO_ATFORK
539#if __linux 539#if __linux
540 int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void * __dso_handle); 540 int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void * __dso_handle);
541 __register_atfork (0, 0, default_fork, 0); 541 __register_atfork (0, 0, default_fork, 0);
542#else 542#else
543 pthread_atfork (0, 0, default_fork); 543 pthread_atfork (0, 0, default_fork);
580NV ev_time () 580NV ev_time ()
581 581
582void ev_feed_signal (SV *signal) 582void ev_feed_signal (SV *signal)
583 CODE: 583 CODE:
584{ 584{
585 Signal signum = s_signum (signal); 585 Signal signum = s_signum (signal);
586 CHECK_SIG (signal, signum); 586 CHECK_SIG (signal, signum);
587 587
588 ev_feed_signal (signum); 588 ev_feed_signal (signum);
589} 589}
590 590
692 periodic_ns = 1 692 periodic_ns = 1
693 INIT: 693 INIT:
694 CHECK_REPEAT (interval); 694 CHECK_REPEAT (interval);
695 CODE: 695 CODE:
696{ 696{
697 ev_periodic *w; 697 ev_periodic *w;
698 w = e_new (sizeof (ev_periodic), cb, default_loop_sv); 698 w = e_new (sizeof (ev_periodic), cb, default_loop_sv);
699 e_fh (w) = SvTRUE (reschedule_cb) ? newSVsv (reschedule_cb) : 0; 699 e_fh (w) = SvTRUE (reschedule_cb) ? newSVsv (reschedule_cb) : 0;
700 ev_periodic_set (w, at, interval, e_fh (w) ? e_periodic_cb : 0); 700 ev_periodic_set (w, at, interval, e_fh (w) ? e_periodic_cb : 0);
701 RETVAL = e_bless ((ev_watcher *)w, stash_periodic); 701 RETVAL = e_bless ((ev_watcher *)w, stash_periodic);
702 if (!ix) START (periodic, w); 702 if (!ix) START (periodic, w);
707ev_signal *signal (SV *signal, SV *cb) 707ev_signal *signal (SV *signal, SV *cb)
708 ALIAS: 708 ALIAS:
709 signal_ns = 1 709 signal_ns = 1
710 CODE: 710 CODE:
711{ 711{
712 Signal signum = s_signum (signal); 712 Signal signum = s_signum (signal);
713 CHECK_SIG (signal, signum); 713 CHECK_SIG (signal, signum);
714 714
715 RETVAL = e_new (sizeof (ev_signal), cb, default_loop_sv); 715 RETVAL = e_new (sizeof (ev_signal), cb, default_loop_sv);
716 ev_signal_set (RETVAL, signum); 716 ev_signal_set (RETVAL, signum);
717 if (!ix) START_SIGNAL (RETVAL); 717 if (!ix) START_SIGNAL (RETVAL);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines