… | |
… | |
59 | |
59 | |
60 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H && !defined (EV_USE_KQUEUE) |
60 | # if HAVE_KQUEUE && HAVE_SYS_EVENT_H && HAVE_SYS_QUEUE_H && !defined (EV_USE_KQUEUE) |
61 | # define EV_USE_KQUEUE 1 |
61 | # define EV_USE_KQUEUE 1 |
62 | # endif |
62 | # endif |
63 | |
63 | |
64 | # if HAVE_PORT_H && HAVE_PORT_H && HAVE_PORT_CREATE && !defined (EV_USE_PORT) |
64 | # if HAVE_PORT_H && HAVE_PORT_CREATE && !defined (EV_USE_PORT) |
65 | # define EV_USE_PORT 1 |
65 | # define EV_USE_PORT 1 |
66 | # endif |
66 | # endif |
67 | |
67 | |
68 | #endif |
68 | #endif |
69 | |
69 | |
… | |
… | |
94 | #endif |
94 | #endif |
95 | |
95 | |
96 | /**/ |
96 | /**/ |
97 | |
97 | |
98 | #ifndef EV_USE_MONOTONIC |
98 | #ifndef EV_USE_MONOTONIC |
99 | # define EV_USE_MONOTONIC 1 |
99 | # define EV_USE_MONOTONIC 0 |
100 | #endif |
100 | #endif |
101 | |
101 | |
102 | #ifndef EV_USE_REALTIME |
102 | #ifndef EV_USE_REALTIME |
103 | # define EV_USE_REALTIME 1 |
103 | # define EV_USE_REALTIME 0 |
104 | #endif |
104 | #endif |
105 | |
105 | |
106 | #ifndef EV_USE_SELECT |
106 | #ifndef EV_USE_SELECT |
107 | # define EV_USE_SELECT 1 |
107 | # define EV_USE_SELECT 1 |
108 | # define EV_SELECT_USE_FD_SET 1 |
|
|
109 | #endif |
108 | #endif |
110 | |
109 | |
111 | #ifndef EV_USE_POLL |
110 | #ifndef EV_USE_POLL |
112 | # ifdef _WIN32 |
111 | # ifdef _WIN32 |
113 | # define EV_USE_POLL 0 |
112 | # define EV_USE_POLL 0 |
… | |
… | |
151 | #endif |
150 | #endif |
152 | |
151 | |
153 | /**/ |
152 | /**/ |
154 | |
153 | |
155 | #define MIN_TIMEJUMP 1. /* minimum timejump that gets detected (if monotonic clock available) */ |
154 | #define MIN_TIMEJUMP 1. /* minimum timejump that gets detected (if monotonic clock available) */ |
156 | #define MAX_BLOCKTIME 59.731 /* never wait longer than this time (to detect time jumps) */ |
155 | #define MAX_BLOCKTIME 59.743 /* never wait longer than this time (to detect time jumps) */ |
157 | #define PID_HASHSIZE 16 /* size of pid hash table, must be power of two */ |
156 | #define PID_HASHSIZE 16 /* size of pid hash table, must be power of two */ |
158 | /*#define CLEANUP_INTERVAL 300. /* how often to try to free memory and re-check fds */ |
157 | /*#define CLEANUP_INTERVAL (MAX_BLOCKTIME * 5.) /* how often to try to free memory and re-check fds */ |
159 | |
158 | |
160 | #ifdef EV_H |
159 | #ifdef EV_H |
161 | # include EV_H |
160 | # include EV_H |
162 | #else |
161 | #else |
163 | # include "ev.h" |
162 | # include "ev.h" |
… | |
… | |
995 | return 1; |
994 | return 1; |
996 | |
995 | |
997 | return 0; |
996 | return 0; |
998 | } |
997 | } |
999 | |
998 | |
1000 | static void |
999 | inline void |
1001 | call_pending (EV_P) |
1000 | call_pending (EV_P) |
1002 | { |
1001 | { |
1003 | int pri; |
1002 | int pri; |
1004 | |
1003 | |
1005 | for (pri = NUMPRI; pri--; ) |
1004 | for (pri = NUMPRI; pri--; ) |
1006 | while (pendingcnt [pri]) |
1005 | while (pendingcnt [pri]) |
1007 | { |
1006 | { |
1008 | ANPENDING *p = pendings [pri] + --pendingcnt [pri]; |
1007 | ANPENDING *p = pendings [pri] + --pendingcnt [pri]; |
1009 | |
1008 | |
1010 | if (p->w) |
1009 | if (expect_true (p->w)) |
1011 | { |
1010 | { |
1012 | p->w->pending = 0; |
1011 | p->w->pending = 0; |
1013 | EV_CB_INVOKE (p->w, p->events); |
1012 | EV_CB_INVOKE (p->w, p->events); |
1014 | } |
1013 | } |
1015 | } |
1014 | } |