… | |
… | |
34 | * by deleting the provisions above and replace them with the notice |
34 | * by deleting the provisions above and replace them with the notice |
35 | * and other provisions required by the GPL. If you do not delete the |
35 | * and other provisions required by the GPL. If you do not delete the |
36 | * provisions above, a recipient may use your version of this file under |
36 | * provisions above, a recipient may use your version of this file under |
37 | * either the BSD or the GPL. |
37 | * either the BSD or the GPL. |
38 | */ |
38 | */ |
|
|
39 | |
|
|
40 | #pragma clang diagnostic ignored "-Wunused-value" |
|
|
41 | #pragma clang diagnostic ignored "-Wcomment" |
|
|
42 | #pragma clang diagnostic ignored "-Wextern-initializer" |
39 | |
43 | |
40 | /* this big block deduces configuration from config.h */ |
44 | /* this big block deduces configuration from config.h */ |
41 | #ifndef EV_STANDALONE |
45 | #ifndef EV_STANDALONE |
42 | # ifdef EV_CONFIG_H |
46 | # ifdef EV_CONFIG_H |
43 | # include EV_CONFIG_H |
47 | # include EV_CONFIG_H |
… | |
… | |
2392 | inline_size void |
2396 | inline_size void |
2393 | fd_reify (EV_P) |
2397 | fd_reify (EV_P) |
2394 | { |
2398 | { |
2395 | int i; |
2399 | int i; |
2396 | |
2400 | |
2397 | /* most backends do not modify the fdchanges list in backend_modfiy. |
2401 | /* most backends do not modify the fdchanges list in backend_modify. |
2398 | * except io_uring, which has fixed-size buffers which might force us |
2402 | * except io_uring, which has fixed-size buffers which might force us |
2399 | * to handle events in backend_modify, causing fdchanges to be amended, |
2403 | * to handle events in backend_modify, causing fdchanges to be amended, |
2400 | * which could result in an endless loop. |
2404 | * which could result in an endless loop. |
2401 | * to avoid this, we do not dynamically handle fds that were added |
2405 | * to avoid this, we do not dynamically handle fds that were added |
2402 | * during fd_reify. that means that for those backends, fdchangecnt |
2406 | * during fd_reify. that means that for those backends, fdchangecnt |
… | |
… | |
3504 | #endif |
3508 | #endif |
3505 | |
3509 | |
3506 | if (postfork != 2) |
3510 | if (postfork != 2) |
3507 | { |
3511 | { |
3508 | #if EV_USE_SIGNALFD |
3512 | #if EV_USE_SIGNALFD |
3509 | /* surprisingly, nothing needs to be done for signalfd, accoridng to docs, it does the right thing on fork */ |
3513 | /* surprisingly, nothing needs to be done for signalfd, according to docs, it does the right thing on fork */ |
3510 | #endif |
3514 | #endif |
3511 | |
3515 | |
3512 | #if EV_USE_TIMERFD |
3516 | #if EV_USE_TIMERFD |
3513 | if (ev_is_active (&timerfd_w)) |
3517 | if (ev_is_active (&timerfd_w)) |
3514 | { |
3518 | { |
… | |
… | |
4092 | |
4096 | |
4093 | if (ecb_expect_true (!(flags & EVRUN_NOWAIT || idleall || !activecnt || pipe_write_skipped))) |
4097 | if (ecb_expect_true (!(flags & EVRUN_NOWAIT || idleall || !activecnt || pipe_write_skipped))) |
4094 | { |
4098 | { |
4095 | waittime = EV_TS_CONST (MAX_BLOCKTIME); |
4099 | waittime = EV_TS_CONST (MAX_BLOCKTIME); |
4096 | |
4100 | |
|
|
4101 | #if EV_USE_MONOTONIC |
|
|
4102 | if (ecb_expect_true (have_monotonic)) |
|
|
4103 | { |
4097 | #if EV_USE_TIMERFD |
4104 | #if EV_USE_TIMERFD |
4098 | /* sleep a lot longer when we can reliably detect timejumps */ |
4105 | /* sleep a lot longer when we can reliably detect timejumps */ |
4099 | if (ecb_expect_true (timerfd >= 0)) |
4106 | if (ecb_expect_true (timerfd != -1)) |
4100 | waittime = EV_TS_CONST (MAX_BLOCKTIME2); |
4107 | waittime = EV_TS_CONST (MAX_BLOCKTIME2); |
4101 | #endif |
4108 | #endif |
4102 | #if !EV_PERIODIC_ENABLE |
4109 | #if !EV_PERIODIC_ENABLE |
4103 | /* without periodics but with monotonic clock there is no need */ |
4110 | /* without periodics but with monotonic clock there is no need */ |
4104 | /* for any time jump detection, so sleep longer */ |
4111 | /* for any time jump detection, so sleep longer */ |
4105 | if (ecb_expect_true (have_monotonic)) |
|
|
4106 | waittime = EV_TS_CONST (MAX_BLOCKTIME2); |
4112 | waittime = EV_TS_CONST (MAX_BLOCKTIME2); |
|
|
4113 | #endif |
|
|
4114 | } |
4107 | #endif |
4115 | #endif |
4108 | |
4116 | |
4109 | if (timercnt) |
4117 | if (timercnt) |
4110 | { |
4118 | { |
4111 | ev_tstamp to = ANHE_at (timers [HEAP0]) - mn_now; |
4119 | ev_tstamp to = ANHE_at (timers [HEAP0]) - mn_now; |