ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.80 by root, Fri Nov 9 15:30:59 2007 UTC vs.
Revision 1.83 by root, Fri Nov 9 21:48:23 2007 UTC

126#define MIN_TIMEJUMP 1. /* minimum timejump that gets detected (if monotonic clock available) */ 126#define MIN_TIMEJUMP 1. /* minimum timejump that gets detected (if monotonic clock available) */
127#define MAX_BLOCKTIME 59.731 /* never wait longer than this time (to detect time jumps) */ 127#define MAX_BLOCKTIME 59.731 /* never wait longer than this time (to detect time jumps) */
128#define PID_HASHSIZE 16 /* size of pid hash table, must be power of two */ 128#define PID_HASHSIZE 16 /* size of pid hash table, must be power of two */
129/*#define CLEANUP_INTERVAL 300. /* how often to try to free memory and re-check fds */ 129/*#define CLEANUP_INTERVAL 300. /* how often to try to free memory and re-check fds */
130 130
131#ifdef EV_H
132# include EV_H
133#else
131#include "ev.h" 134# include "ev.h"
135#endif
132 136
133#if __GNUC__ >= 3 137#if __GNUC__ >= 3
134# define expect(expr,value) __builtin_expect ((expr),(value)) 138# define expect(expr,value) __builtin_expect ((expr),(value))
135# define inline inline 139# define inline inline
136#else 140#else
747#endif 751#endif
748#if EV_USE_SELECT 752#if EV_USE_SELECT
749 if (!method && (methods & EVMETHOD_SELECT)) method = select_init (EV_A_ methods); 753 if (!method && (methods & EVMETHOD_SELECT)) method = select_init (EV_A_ methods);
750#endif 754#endif
751 755
752 ev_watcher_init (&sigev, sigcb); 756 ev_init (&sigev, sigcb);
753 ev_set_priority (&sigev, EV_MAXPRI); 757 ev_set_priority (&sigev, EV_MAXPRI);
754 } 758 }
755} 759}
756 760
757void 761void
944 ANPENDING *p = pendings [pri] + --pendingcnt [pri]; 948 ANPENDING *p = pendings [pri] + --pendingcnt [pri];
945 949
946 if (p->w) 950 if (p->w)
947 { 951 {
948 p->w->pending = 0; 952 p->w->pending = 0;
949 p->w->cb (EV_A_ p->w, p->events); 953 EV_CB_INVOKE (p->w, p->events);
950 } 954 }
951 } 955 }
952} 956}
953 957
954static void 958static void
1560 else 1564 else
1561 { 1565 {
1562 once->cb = cb; 1566 once->cb = cb;
1563 once->arg = arg; 1567 once->arg = arg;
1564 1568
1565 ev_watcher_init (&once->io, once_cb_io); 1569 ev_init (&once->io, once_cb_io);
1566 if (fd >= 0) 1570 if (fd >= 0)
1567 { 1571 {
1568 ev_io_set (&once->io, fd, events); 1572 ev_io_set (&once->io, fd, events);
1569 ev_io_start (EV_A_ &once->io); 1573 ev_io_start (EV_A_ &once->io);
1570 } 1574 }
1571 1575
1572 ev_watcher_init (&once->to, once_cb_to); 1576 ev_init (&once->to, once_cb_to);
1573 if (timeout >= 0.) 1577 if (timeout >= 0.)
1574 { 1578 {
1575 ev_timer_set (&once->to, timeout, 0.); 1579 ev_timer_set (&once->to, timeout, 0.);
1576 ev_timer_start (EV_A_ &once->to); 1580 ev_timer_start (EV_A_ &once->to);
1577 } 1581 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines