summaryrefslogtreecommitdiff
path: root/epoll.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-11-27 16:44:47 -0500
committerNick Mathewson <nickm@torproject.org>2009-11-27 17:36:51 -0500
commit76cd2b70bb64962636cba0073571d0694b9c237a (patch)
tree42519b66630688712b528d0cb0cf1855c0ad0a92 /epoll.c
parent347952ffe0039369ff4e7c94c4e27e7333ba8ecb (diff)
downloadlibevent-76cd2b70bb64962636cba0073571d0694b9c237a.tar.gz
Stop passing EVTHREAD_READ and EVTHREAD_WRITE to non-rw locks.
Previously, our default lock model kind of assumed that every lock was potentially a read-write lock. This was a poor choice, since read-write locks are far more expensive than regular locks, and so the lock API should only use them when we can actually take advantage of them. Neither our pthreads or win32 lock implementation provided rw locks. Now that we have a way (not currently used!) to indicate that we really want a read-write lock, we shouldn't actually say "lock this for reading" or "lock this for writing" unless we mean it.
Diffstat (limited to 'epoll.c')
-rw-r--r--epoll.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/epoll.c b/epoll.c
index 17215164..03d4bb22 100644
--- a/epoll.c
+++ b/epoll.c
@@ -145,11 +145,11 @@ epoll_dispatch(struct event_base *base, struct timeval *tv)
timeout = MAX_EPOLL_TIMEOUT_MSEC;
}
- EVBASE_RELEASE_LOCK(base, EVTHREAD_WRITE, th_base_lock);
+ EVBASE_RELEASE_LOCK(base, th_base_lock);
res = epoll_wait(epollop->epfd, events, epollop->nevents, timeout);
- EVBASE_ACQUIRE_LOCK(base, EVTHREAD_WRITE, th_base_lock);
+ EVBASE_ACQUIRE_LOCK(base, th_base_lock);
if (res == -1) {
if (errno != EINTR) {