diff options
Diffstat (limited to 'ev_kqueue.c')
-rw-r--r-- | ev_kqueue.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/ev_kqueue.c b/ev_kqueue.c index ac73f7c..c5f4eb7 100644 --- a/ev_kqueue.c +++ b/ev_kqueue.c @@ -85,8 +85,6 @@ kqueue_poll (EV_P_ ev_tstamp timeout) int res, i; struct timespec ts; - EV_RELEASE_CB; - /* need to resize so there is enough space for errors */ if (kqueue_changecnt > kqueue_eventmax) { @@ -95,12 +93,12 @@ kqueue_poll (EV_P_ ev_tstamp timeout) kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); } + EV_RELEASE_CB; ts.tv_sec = (time_t)timeout; ts.tv_nsec = (long)((timeout - (ev_tstamp)ts.tv_sec) * 1e9); res = kevent (backend_fd, kqueue_changes, kqueue_changecnt, kqueue_events, kqueue_eventmax, &ts); - kqueue_changecnt = 0; - EV_ACQUIRE_CB; + kqueue_changecnt = 0; if (expect_false (res < 0)) { |