… | |
… | |
815 | select (0, 0, 0, 0, &tv); |
815 | select (0, 0, 0, 0, &tv); |
816 | #endif |
816 | #endif |
817 | } |
817 | } |
818 | } |
818 | } |
819 | |
819 | |
|
|
820 | inline_speed int |
|
|
821 | ev_timeout_to_ms (ev_tstamp timeout) |
|
|
822 | { |
|
|
823 | int ms = timeout * 1000. + .999999; |
|
|
824 | |
|
|
825 | return expect_true (ms) ? ms : timeout < 1e-6 ? 0 : 1; |
|
|
826 | } |
|
|
827 | |
820 | /*****************************************************************************/ |
828 | /*****************************************************************************/ |
821 | |
829 | |
822 | #define MALLOC_ROUND 4096 /* prefer to allocate in chunks of this size, must be 2**n and >> 4 longs */ |
830 | #define MALLOC_ROUND 4096 /* prefer to allocate in chunks of this size, must be 2**n and >> 4 longs */ |
823 | |
831 | |
824 | /* find a suitable new size for the given array, */ |
832 | /* find a suitable new size for the given array, */ |
… | |
… | |
1343 | char dummy; |
1351 | char dummy; |
1344 | /* see discussion in evpipe_write when you think this read should be recv in win32 */ |
1352 | /* see discussion in evpipe_write when you think this read should be recv in win32 */ |
1345 | read (evpipe [0], &dummy, 1); |
1353 | read (evpipe [0], &dummy, 1); |
1346 | } |
1354 | } |
1347 | |
1355 | |
|
|
1356 | #if EV_SIGNAL_ENABLE |
1348 | if (sig_pending) |
1357 | if (sig_pending) |
1349 | { |
1358 | { |
1350 | sig_pending = 0; |
1359 | sig_pending = 0; |
1351 | |
1360 | |
1352 | for (i = EV_NSIG - 1; i--; ) |
1361 | for (i = EV_NSIG - 1; i--; ) |
1353 | if (expect_false (signals [i].pending)) |
1362 | if (expect_false (signals [i].pending)) |
1354 | ev_feed_signal_event (EV_A_ i + 1); |
1363 | ev_feed_signal_event (EV_A_ i + 1); |
1355 | } |
1364 | } |
|
|
1365 | #endif |
1356 | |
1366 | |
1357 | #if EV_ASYNC_ENABLE |
1367 | #if EV_ASYNC_ENABLE |
1358 | if (async_pending) |
1368 | if (async_pending) |
1359 | { |
1369 | { |
1360 | async_pending = 0; |
1370 | async_pending = 0; |
… | |
… | |
2110 | |
2120 | |
2111 | for (pri = NUMPRI; pri--; ) |
2121 | for (pri = NUMPRI; pri--; ) |
2112 | while (pendingcnt [pri]) |
2122 | while (pendingcnt [pri]) |
2113 | { |
2123 | { |
2114 | ANPENDING *p = pendings [pri] + --pendingcnt [pri]; |
2124 | ANPENDING *p = pendings [pri] + --pendingcnt [pri]; |
2115 | |
|
|
2116 | /*assert (("libev: non-pending watcher on pending list", p->w->pending));*/ |
|
|
2117 | /* ^ this is no longer true, as pending_w could be here */ |
|
|
2118 | |
2125 | |
2119 | p->w->pending = 0; |
2126 | p->w->pending = 0; |
2120 | EV_CB_INVOKE (p->w, p->events); |
2127 | EV_CB_INVOKE (p->w, p->events); |
2121 | EV_FREQUENT_CHECK; |
2128 | EV_FREQUENT_CHECK; |
2122 | } |
2129 | } |