summaryrefslogtreecommitdiff
path: root/epoll.c
diff options
context:
space:
mode:
Diffstat (limited to 'epoll.c')
-rw-r--r--epoll.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/epoll.c b/epoll.c
index b6fa28ed..a01e501f 100644
--- a/epoll.c
+++ b/epoll.c
@@ -51,6 +51,8 @@
#include "event-internal.h"
#include "evsignal-internal.h"
+#include "event2/thread.h"
+#include "evthread-internal.h"
#include "log-internal.h"
#include "evmap-internal.h"
@@ -148,8 +150,12 @@ epoll_dispatch(struct event_base *base, struct timeval *tv)
timeout = MAX_EPOLL_TIMEOUT_MSEC;
}
+ EVBASE_RELEASE_LOCK(base, EVTHREAD_WRITE, th_base_lock);
+
res = epoll_wait(epollop->epfd, events, epollop->nevents, timeout);
+ EVBASE_ACQUIRE_LOCK(base, EVTHREAD_WRITE, th_base_lock);
+
if (res == -1) {
if (errno != EINTR) {
event_warn("epoll_wait");