… | |
… | |
284 | |
284 | |
285 | #ifndef EV_HEAP_CACHE_AT |
285 | #ifndef EV_HEAP_CACHE_AT |
286 | # define EV_HEAP_CACHE_AT !EV_MINIMAL |
286 | # define EV_HEAP_CACHE_AT !EV_MINIMAL |
287 | #endif |
287 | #endif |
288 | |
288 | |
289 | /* this block fixes any misconfiguration where we know we run into trouble otherwise */ |
|
|
290 | |
|
|
291 | #ifndef CLOCK_MONOTONIC |
|
|
292 | # undef EV_USE_MONOTONIC |
|
|
293 | # define EV_USE_MONOTONIC 0 |
|
|
294 | #endif |
|
|
295 | |
|
|
296 | #ifndef CLOCK_REALTIME |
|
|
297 | # undef EV_USE_REALTIME |
|
|
298 | # define EV_USE_REALTIME 0 |
|
|
299 | #endif |
|
|
300 | |
|
|
301 | #if !EV_STAT_ENABLE |
|
|
302 | # undef EV_USE_INOTIFY |
|
|
303 | # define EV_USE_INOTIFY 0 |
|
|
304 | #endif |
|
|
305 | |
|
|
306 | #if !EV_USE_NANOSLEEP |
|
|
307 | # ifndef _WIN32 |
|
|
308 | # include <sys/select.h> |
|
|
309 | # endif |
|
|
310 | #endif |
|
|
311 | |
|
|
312 | #if EV_USE_INOTIFY |
|
|
313 | # include <sys/utsname.h> |
|
|
314 | # include <sys/statfs.h> |
|
|
315 | # include <sys/inotify.h> |
|
|
316 | /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ |
|
|
317 | # ifndef IN_DONT_FOLLOW |
|
|
318 | # undef EV_USE_INOTIFY |
|
|
319 | # define EV_USE_INOTIFY 0 |
|
|
320 | # endif |
|
|
321 | #endif |
|
|
322 | |
|
|
323 | #if EV_SELECT_IS_WINSOCKET |
|
|
324 | # include <winsock.h> |
|
|
325 | #endif |
|
|
326 | |
|
|
327 | /* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */ |
289 | /* on linux, we can use a (slow) syscall to avoid a dependency on pthread, */ |
328 | /* which makes programs even slower. might work on other unices, too. */ |
290 | /* which makes programs even slower. might work on other unices, too. */ |
329 | #if EV_USE_CLOCK_SYSCALL |
291 | #if EV_USE_CLOCK_SYSCALL |
330 | # include <syscall.h> |
292 | # include <syscall.h> |
331 | # ifdef SYS_clock_gettime |
293 | # ifdef SYS_clock_gettime |
… | |
… | |
336 | # undef EV_USE_CLOCK_SYSCALL |
298 | # undef EV_USE_CLOCK_SYSCALL |
337 | # define EV_USE_CLOCK_SYSCALL 0 |
299 | # define EV_USE_CLOCK_SYSCALL 0 |
338 | # endif |
300 | # endif |
339 | #endif |
301 | #endif |
340 | |
302 | |
|
|
303 | /* this block fixes any misconfiguration where we know we run into trouble otherwise */ |
|
|
304 | |
|
|
305 | #ifndef CLOCK_MONOTONIC |
|
|
306 | # undef EV_USE_MONOTONIC |
|
|
307 | # define EV_USE_MONOTONIC 0 |
|
|
308 | #endif |
|
|
309 | |
|
|
310 | #ifndef CLOCK_REALTIME |
|
|
311 | # undef EV_USE_REALTIME |
|
|
312 | # define EV_USE_REALTIME 0 |
|
|
313 | #endif |
|
|
314 | |
|
|
315 | #if !EV_STAT_ENABLE |
|
|
316 | # undef EV_USE_INOTIFY |
|
|
317 | # define EV_USE_INOTIFY 0 |
|
|
318 | #endif |
|
|
319 | |
|
|
320 | #if !EV_USE_NANOSLEEP |
|
|
321 | # ifndef _WIN32 |
|
|
322 | # include <sys/select.h> |
|
|
323 | # endif |
|
|
324 | #endif |
|
|
325 | |
|
|
326 | #if EV_USE_INOTIFY |
|
|
327 | # include <sys/utsname.h> |
|
|
328 | # include <sys/statfs.h> |
|
|
329 | # include <sys/inotify.h> |
|
|
330 | /* some very old inotify.h headers don't have IN_DONT_FOLLOW */ |
|
|
331 | # ifndef IN_DONT_FOLLOW |
|
|
332 | # undef EV_USE_INOTIFY |
|
|
333 | # define EV_USE_INOTIFY 0 |
|
|
334 | # endif |
|
|
335 | #endif |
|
|
336 | |
|
|
337 | #if EV_SELECT_IS_WINSOCKET |
|
|
338 | # include <winsock.h> |
|
|
339 | #endif |
|
|
340 | |
341 | #if EV_USE_EVENTFD |
341 | #if EV_USE_EVENTFD |
342 | /* our minimum requirement is glibc 2.7 which has the stub, but not the header */ |
342 | /* our minimum requirement is glibc 2.7 which has the stub, but not the header */ |
343 | # include <stdint.h> |
343 | # include <stdint.h> |
344 | # ifdef __cplusplus |
344 | # ifdef __cplusplus |
345 | extern "C" { |
345 | extern "C" { |
… | |
… | |
391 | # define inline_speed static noinline |
391 | # define inline_speed static noinline |
392 | #else |
392 | #else |
393 | # define inline_speed static inline |
393 | # define inline_speed static inline |
394 | #endif |
394 | #endif |
395 | |
395 | |
396 | #define NUMPRI (EV_MAXPRI - EV_MINPRI + 1) |
396 | #define NUMPRI (EV_MAXPRI - EV_MINPRI + 1) |
|
|
397 | |
|
|
398 | #if EV_MINPRI == EV_MAXPRI |
|
|
399 | # define ABSPRI(w) (((W)w), 0) |
|
|
400 | #else |
397 | #define ABSPRI(w) (((W)w)->priority - EV_MINPRI) |
401 | # define ABSPRI(w) (((W)w)->priority - EV_MINPRI) |
|
|
402 | #endif |
398 | |
403 | |
399 | #define EMPTY /* required for microsofts broken pseudo-c compiler */ |
404 | #define EMPTY /* required for microsofts broken pseudo-c compiler */ |
400 | #define EMPTY2(a,b) /* used to suppress some warnings */ |
405 | #define EMPTY2(a,b) /* used to suppress some warnings */ |
401 | |
406 | |
402 | typedef ev_watcher *W; |
407 | typedef ev_watcher *W; |
… | |
… | |
562 | |
567 | |
563 | static int ev_default_loop_ptr; |
568 | static int ev_default_loop_ptr; |
564 | |
569 | |
565 | #endif |
570 | #endif |
566 | |
571 | |
|
|
572 | #if EV_MINIMAL < 2 |
|
|
573 | # define EV_SUSPEND_CB if (expect_false (suspend_cb)) suspend_cb (EV_A) |
|
|
574 | # define EV_RESUME_CB if (expect_false (resume_cb )) resume_cb (EV_A) |
|
|
575 | # define EV_INVOKE_PENDING invoke_cb (EV_A) |
|
|
576 | #else |
|
|
577 | # define EV_SUSPEND_CB (void)0 |
|
|
578 | # define EV_RESUME_CB (void)0 |
|
|
579 | # define EV_INVOKE_PENDING ev_invoke_pending (EV_A) |
|
|
580 | #endif |
|
|
581 | |
567 | /*****************************************************************************/ |
582 | /*****************************************************************************/ |
568 | |
583 | |
|
|
584 | #ifndef EV_HAVE_EV_TIME |
569 | ev_tstamp |
585 | ev_tstamp |
570 | ev_time (void) |
586 | ev_time (void) |
571 | { |
587 | { |
572 | #if EV_USE_REALTIME |
588 | #if EV_USE_REALTIME |
573 | if (expect_true (have_realtime)) |
589 | if (expect_true (have_realtime)) |
… | |
… | |
580 | |
596 | |
581 | struct timeval tv; |
597 | struct timeval tv; |
582 | gettimeofday (&tv, 0); |
598 | gettimeofday (&tv, 0); |
583 | return tv.tv_sec + tv.tv_usec * 1e-6; |
599 | return tv.tv_sec + tv.tv_usec * 1e-6; |
584 | } |
600 | } |
|
|
601 | #endif |
585 | |
602 | |
586 | inline_size ev_tstamp |
603 | inline_size ev_tstamp |
587 | get_clock (void) |
604 | get_clock (void) |
588 | { |
605 | { |
589 | #if EV_USE_MONOTONIC |
606 | #if EV_USE_MONOTONIC |
… | |
… | |
625 | |
642 | |
626 | tv.tv_sec = (time_t)delay; |
643 | tv.tv_sec = (time_t)delay; |
627 | tv.tv_usec = (long)((delay - (ev_tstamp)(tv.tv_sec)) * 1e6); |
644 | tv.tv_usec = (long)((delay - (ev_tstamp)(tv.tv_sec)) * 1e6); |
628 | |
645 | |
629 | /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */ |
646 | /* here we rely on sys/time.h + sys/types.h + unistd.h providing select */ |
630 | /* somehting nto guaranteed by newer posix versions, but guaranteed */ |
647 | /* somehting not guaranteed by newer posix versions, but guaranteed */ |
631 | /* by older ones */ |
648 | /* by older ones */ |
632 | select (0, 0, 0, 0, &tv); |
649 | select (0, 0, 0, 0, &tv); |
633 | #endif |
650 | #endif |
634 | } |
651 | } |
635 | } |
652 | } |
… | |
… | |
1350 | ev_backend (EV_P) |
1367 | ev_backend (EV_P) |
1351 | { |
1368 | { |
1352 | return backend; |
1369 | return backend; |
1353 | } |
1370 | } |
1354 | |
1371 | |
|
|
1372 | #if EV_MINIMAL < 2 |
1355 | unsigned int |
1373 | unsigned int |
1356 | ev_loop_count (EV_P) |
1374 | ev_loop_count (EV_P) |
1357 | { |
1375 | { |
1358 | return loop_count; |
1376 | return loop_count; |
1359 | } |
1377 | } |
1360 | |
1378 | |
|
|
1379 | unsigned int |
|
|
1380 | ev_loop_depth (EV_P) |
|
|
1381 | { |
|
|
1382 | return loop_depth; |
|
|
1383 | } |
|
|
1384 | |
1361 | void |
1385 | void |
1362 | ev_set_io_collect_interval (EV_P_ ev_tstamp interval) |
1386 | ev_set_io_collect_interval (EV_P_ ev_tstamp interval) |
1363 | { |
1387 | { |
1364 | io_blocktime = interval; |
1388 | io_blocktime = interval; |
1365 | } |
1389 | } |
… | |
… | |
1367 | void |
1391 | void |
1368 | ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval) |
1392 | ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval) |
1369 | { |
1393 | { |
1370 | timeout_blocktime = interval; |
1394 | timeout_blocktime = interval; |
1371 | } |
1395 | } |
|
|
1396 | |
|
|
1397 | void |
|
|
1398 | ev_set_userdata (EV_P_ void *data) |
|
|
1399 | { |
|
|
1400 | userdata = data; |
|
|
1401 | } |
|
|
1402 | |
|
|
1403 | void * |
|
|
1404 | ev_userdata (EV_P) |
|
|
1405 | { |
|
|
1406 | return userdata; |
|
|
1407 | } |
|
|
1408 | |
|
|
1409 | void ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P)) |
|
|
1410 | { |
|
|
1411 | invoke_cb = invoke_pending_cb; |
|
|
1412 | } |
|
|
1413 | |
|
|
1414 | void ev_set_blocking_cb (EV_P_ void (*suspend_cb_)(EV_P), void (*resume_cb_)(EV_P)) |
|
|
1415 | { |
|
|
1416 | suspend_cb = suspend_cb_; |
|
|
1417 | resume_cb = resume_cb_; |
|
|
1418 | } |
|
|
1419 | #endif |
1372 | |
1420 | |
1373 | /* initialise a loop structure, must be zero-initialised */ |
1421 | /* initialise a loop structure, must be zero-initialised */ |
1374 | static void noinline |
1422 | static void noinline |
1375 | loop_init (EV_P_ unsigned int flags) |
1423 | loop_init (EV_P_ unsigned int flags) |
1376 | { |
1424 | { |
… | |
… | |
1398 | |
1446 | |
1399 | ev_rt_now = ev_time (); |
1447 | ev_rt_now = ev_time (); |
1400 | mn_now = get_clock (); |
1448 | mn_now = get_clock (); |
1401 | now_floor = mn_now; |
1449 | now_floor = mn_now; |
1402 | rtmn_diff = ev_rt_now - mn_now; |
1450 | rtmn_diff = ev_rt_now - mn_now; |
|
|
1451 | #if EV_MINIMAL < 2 |
|
|
1452 | invoke_cb = ev_invoke_pending; |
|
|
1453 | #endif |
1403 | |
1454 | |
1404 | io_blocktime = 0.; |
1455 | io_blocktime = 0.; |
1405 | timeout_blocktime = 0.; |
1456 | timeout_blocktime = 0.; |
1406 | backend = 0; |
1457 | backend = 0; |
1407 | backend_fd = -1; |
1458 | backend_fd = -1; |
… | |
… | |
1601 | void |
1652 | void |
1602 | ev_loop_fork (EV_P) |
1653 | ev_loop_fork (EV_P) |
1603 | { |
1654 | { |
1604 | postfork = 1; /* must be in line with ev_default_fork */ |
1655 | postfork = 1; /* must be in line with ev_default_fork */ |
1605 | } |
1656 | } |
|
|
1657 | #endif /* multiplicity */ |
1606 | |
1658 | |
1607 | #if EV_VERIFY |
1659 | #if EV_VERIFY |
1608 | static void noinline |
1660 | static void noinline |
1609 | verify_watcher (EV_P_ W w) |
1661 | verify_watcher (EV_P_ W w) |
1610 | { |
1662 | { |
… | |
… | |
1638 | verify_watcher (EV_A_ ws [cnt]); |
1690 | verify_watcher (EV_A_ ws [cnt]); |
1639 | } |
1691 | } |
1640 | } |
1692 | } |
1641 | #endif |
1693 | #endif |
1642 | |
1694 | |
|
|
1695 | #if EV_MINIMAL < 2 |
1643 | void |
1696 | void |
1644 | ev_loop_verify (EV_P) |
1697 | ev_loop_verify (EV_P) |
1645 | { |
1698 | { |
1646 | #if EV_VERIFY |
1699 | #if EV_VERIFY |
1647 | int i; |
1700 | int i; |
… | |
… | |
1700 | for (w = (ev_child *)childs [chain & (EV_PID_HASHSIZE - 1)]; w; w = (ev_child *)((WL)w)->next) |
1753 | for (w = (ev_child *)childs [chain & (EV_PID_HASHSIZE - 1)]; w; w = (ev_child *)((WL)w)->next) |
1701 | for (signum = signalmax; signum--; ) if (signals [signum].gotsig) |
1754 | for (signum = signalmax; signum--; ) if (signals [signum].gotsig) |
1702 | # endif |
1755 | # endif |
1703 | #endif |
1756 | #endif |
1704 | } |
1757 | } |
1705 | |
1758 | #endif |
1706 | #endif /* multiplicity */ |
|
|
1707 | |
1759 | |
1708 | #if EV_MULTIPLICITY |
1760 | #if EV_MULTIPLICITY |
1709 | struct ev_loop * |
1761 | struct ev_loop * |
1710 | ev_default_loop_init (unsigned int flags) |
1762 | ev_default_loop_init (unsigned int flags) |
1711 | #else |
1763 | #else |
… | |
… | |
1772 | ev_invoke (EV_P_ void *w, int revents) |
1824 | ev_invoke (EV_P_ void *w, int revents) |
1773 | { |
1825 | { |
1774 | EV_CB_INVOKE ((W)w, revents); |
1826 | EV_CB_INVOKE ((W)w, revents); |
1775 | } |
1827 | } |
1776 | |
1828 | |
1777 | inline_speed void |
1829 | void noinline |
1778 | call_pending (EV_P) |
1830 | ev_invoke_pending (EV_P) |
1779 | { |
1831 | { |
1780 | int pri; |
1832 | int pri; |
1781 | |
1833 | |
1782 | for (pri = NUMPRI; pri--; ) |
1834 | for (pri = NUMPRI; pri--; ) |
1783 | while (pendingcnt [pri]) |
1835 | while (pendingcnt [pri]) |
… | |
… | |
2018 | |
2070 | |
2019 | mn_now = ev_rt_now; |
2071 | mn_now = ev_rt_now; |
2020 | } |
2072 | } |
2021 | } |
2073 | } |
2022 | |
2074 | |
2023 | static int loop_done; |
|
|
2024 | |
|
|
2025 | void |
2075 | void |
2026 | ev_loop (EV_P_ int flags) |
2076 | ev_loop (EV_P_ int flags) |
2027 | { |
2077 | { |
|
|
2078 | #if EV_MINIMAL < 2 |
|
|
2079 | ++loop_depth; |
|
|
2080 | #endif |
|
|
2081 | |
2028 | loop_done = EVUNLOOP_CANCEL; |
2082 | loop_done = EVUNLOOP_CANCEL; |
2029 | |
2083 | |
2030 | call_pending (EV_A); /* in case we recurse, ensure ordering stays nice and clean */ |
2084 | EV_INVOKE_PENDING; /* in case we recurse, ensure ordering stays nice and clean */ |
2031 | |
2085 | |
2032 | do |
2086 | do |
2033 | { |
2087 | { |
2034 | #if EV_VERIFY >= 2 |
2088 | #if EV_VERIFY >= 2 |
2035 | ev_loop_verify (EV_A); |
2089 | ev_loop_verify (EV_A); |
… | |
… | |
2048 | /* we might have forked, so queue fork handlers */ |
2102 | /* we might have forked, so queue fork handlers */ |
2049 | if (expect_false (postfork)) |
2103 | if (expect_false (postfork)) |
2050 | if (forkcnt) |
2104 | if (forkcnt) |
2051 | { |
2105 | { |
2052 | queue_events (EV_A_ (W *)forks, forkcnt, EV_FORK); |
2106 | queue_events (EV_A_ (W *)forks, forkcnt, EV_FORK); |
2053 | call_pending (EV_A); |
2107 | EV_INVOKE_PENDING; |
2054 | } |
2108 | } |
2055 | #endif |
2109 | #endif |
2056 | |
2110 | |
2057 | /* queue prepare watchers (and execute them) */ |
2111 | /* queue prepare watchers (and execute them) */ |
2058 | if (expect_false (preparecnt)) |
2112 | if (expect_false (preparecnt)) |
2059 | { |
2113 | { |
2060 | queue_events (EV_A_ (W *)prepares, preparecnt, EV_PREPARE); |
2114 | queue_events (EV_A_ (W *)prepares, preparecnt, EV_PREPARE); |
2061 | call_pending (EV_A); |
2115 | EV_INVOKE_PENDING; |
2062 | } |
2116 | } |
2063 | |
2117 | |
2064 | /* we might have forked, so reify kernel state if necessary */ |
2118 | /* we might have forked, so reify kernel state if necessary */ |
2065 | if (expect_false (postfork)) |
2119 | if (expect_false (postfork)) |
2066 | loop_fork (EV_A); |
2120 | loop_fork (EV_A); |
… | |
… | |
2073 | ev_tstamp waittime = 0.; |
2127 | ev_tstamp waittime = 0.; |
2074 | ev_tstamp sleeptime = 0.; |
2128 | ev_tstamp sleeptime = 0.; |
2075 | |
2129 | |
2076 | if (expect_true (!(flags & EVLOOP_NONBLOCK || idleall || !activecnt))) |
2130 | if (expect_true (!(flags & EVLOOP_NONBLOCK || idleall || !activecnt))) |
2077 | { |
2131 | { |
|
|
2132 | /* remember old timestamp for io_blocktime calculation */ |
|
|
2133 | ev_tstamp prev_mn_now = mn_now; |
|
|
2134 | |
2078 | /* update time to cancel out callback processing overhead */ |
2135 | /* update time to cancel out callback processing overhead */ |
2079 | time_update (EV_A_ 1e100); |
2136 | time_update (EV_A_ 1e100); |
2080 | |
2137 | |
2081 | waittime = MAX_BLOCKTIME; |
2138 | waittime = MAX_BLOCKTIME; |
2082 | |
2139 | |
… | |
… | |
2092 | ev_tstamp to = ANHE_at (periodics [HEAP0]) - ev_rt_now + backend_fudge; |
2149 | ev_tstamp to = ANHE_at (periodics [HEAP0]) - ev_rt_now + backend_fudge; |
2093 | if (waittime > to) waittime = to; |
2150 | if (waittime > to) waittime = to; |
2094 | } |
2151 | } |
2095 | #endif |
2152 | #endif |
2096 | |
2153 | |
|
|
2154 | /* don't let timeouts decrease the waittime below timeout_blocktime */ |
2097 | if (expect_false (waittime < timeout_blocktime)) |
2155 | if (expect_false (waittime < timeout_blocktime)) |
2098 | waittime = timeout_blocktime; |
2156 | waittime = timeout_blocktime; |
2099 | |
2157 | |
2100 | sleeptime = waittime - backend_fudge; |
2158 | /* extra check because io_blocktime is commonly 0 */ |
2101 | |
|
|
2102 | if (expect_true (sleeptime > io_blocktime)) |
2159 | if (expect_false (io_blocktime)) |
2103 | sleeptime = io_blocktime; |
|
|
2104 | |
|
|
2105 | if (sleeptime) |
|
|
2106 | { |
2160 | { |
|
|
2161 | sleeptime = io_blocktime - (mn_now - prev_mn_now); |
|
|
2162 | |
|
|
2163 | if (sleeptime > waittime - backend_fudge) |
|
|
2164 | sleeptime = waittime - backend_fudge; |
|
|
2165 | |
|
|
2166 | if (expect_true (sleeptime > 0.)) |
|
|
2167 | { |
2107 | ev_sleep (sleeptime); |
2168 | ev_sleep (sleeptime); |
2108 | waittime -= sleeptime; |
2169 | waittime -= sleeptime; |
|
|
2170 | } |
2109 | } |
2171 | } |
2110 | } |
2172 | } |
2111 | |
2173 | |
|
|
2174 | #if EV_MINIMAL < 2 |
2112 | ++loop_count; |
2175 | ++loop_count; |
|
|
2176 | #endif |
2113 | backend_poll (EV_A_ waittime); |
2177 | backend_poll (EV_A_ waittime); |
2114 | |
2178 | |
2115 | /* update ev_rt_now, do magic */ |
2179 | /* update ev_rt_now, do magic */ |
2116 | time_update (EV_A_ waittime + sleeptime); |
2180 | time_update (EV_A_ waittime + sleeptime); |
2117 | } |
2181 | } |
… | |
… | |
2129 | |
2193 | |
2130 | /* queue check watchers, to be executed first */ |
2194 | /* queue check watchers, to be executed first */ |
2131 | if (expect_false (checkcnt)) |
2195 | if (expect_false (checkcnt)) |
2132 | queue_events (EV_A_ (W *)checks, checkcnt, EV_CHECK); |
2196 | queue_events (EV_A_ (W *)checks, checkcnt, EV_CHECK); |
2133 | |
2197 | |
2134 | call_pending (EV_A); |
2198 | EV_INVOKE_PENDING; |
2135 | } |
2199 | } |
2136 | while (expect_true ( |
2200 | while (expect_true ( |
2137 | activecnt |
2201 | activecnt |
2138 | && !loop_done |
2202 | && !loop_done |
2139 | && !(flags & (EVLOOP_ONESHOT | EVLOOP_NONBLOCK)) |
2203 | && !(flags & (EVLOOP_ONESHOT | EVLOOP_NONBLOCK)) |
2140 | )); |
2204 | )); |
2141 | |
2205 | |
2142 | if (loop_done == EVUNLOOP_ONE) |
2206 | if (loop_done == EVUNLOOP_ONE) |
2143 | loop_done = EVUNLOOP_CANCEL; |
2207 | loop_done = EVUNLOOP_CANCEL; |
|
|
2208 | |
|
|
2209 | #if EV_MINIMAL < 2 |
|
|
2210 | --loop_depth; |
|
|
2211 | #endif |
2144 | } |
2212 | } |
2145 | |
2213 | |
2146 | void |
2214 | void |
2147 | ev_unloop (EV_P_ int how) |
2215 | ev_unloop (EV_P_ int how) |
2148 | { |
2216 | { |
… | |
… | |
2240 | } |
2308 | } |
2241 | |
2309 | |
2242 | inline_size void |
2310 | inline_size void |
2243 | pri_adjust (EV_P_ W w) |
2311 | pri_adjust (EV_P_ W w) |
2244 | { |
2312 | { |
2245 | int pri = w->priority; |
2313 | int pri = ev_priority (w); |
2246 | pri = pri < EV_MINPRI ? EV_MINPRI : pri; |
2314 | pri = pri < EV_MINPRI ? EV_MINPRI : pri; |
2247 | pri = pri > EV_MAXPRI ? EV_MAXPRI : pri; |
2315 | pri = pri > EV_MAXPRI ? EV_MAXPRI : pri; |
2248 | w->priority = pri; |
2316 | ev_set_priority (w, pri); |
2249 | } |
2317 | } |
2250 | |
2318 | |
2251 | inline_speed void |
2319 | inline_speed void |
2252 | ev_start (EV_P_ W w, int active) |
2320 | ev_start (EV_P_ W w, int active) |
2253 | { |
2321 | { |