summaryrefslogtreecommitdiff
path: root/defer-internal.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-11-27 15:20:43 -0500
committerNick Mathewson <nickm@torproject.org>2009-11-27 17:36:24 -0500
commit347952ffe0039369ff4e7c94c4e27e7333ba8ecb (patch)
tree51a3147fc57fdfa8290ba880f01068a26f626394 /defer-internal.h
parente1ffbb82e34d786d07a5acdb16077f6526f610c3 (diff)
downloadlibevent-347952ffe0039369ff4e7c94c4e27e7333ba8ecb.tar.gz
Revise the locking API: deprecate the old locking callbacks and add trylock.
Previously, there was no good way to request different kinds of lock (say, read/write vs writeonly or recursive vs nonrecursive), or for a lock function to signal failure (which would be important for a trylock mode). This patch revises the lock API to be a bit more useful. The older lock calls are still supported for now. We also add a debugging mode to catch common errors in using the locking APIs.
Diffstat (limited to 'defer-internal.h')
-rw-r--r--defer-internal.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/defer-internal.h b/defer-internal.h
index a1b1d2c8..8a73dccc 100644
--- a/defer-internal.h
+++ b/defer-internal.h
@@ -88,15 +88,13 @@ void event_deferred_cb_schedule(struct deferred_cb_queue *, struct deferred_cb *
#define LOCK_DEFERRED_QUEUE(q) \
do { \
if ((q)->lock) \
- _evthread_locking_fn(EVTHREAD_LOCK|EVTHREAD_WRITE, \
- (q)->lock); \
+ _evthread_lock_fns.lock(0, (q)->lock); \
} while (0)
#define UNLOCK_DEFERRED_QUEUE(q) \
do { \
if ((q)->lock) \
- _evthread_locking_fn(EVTHREAD_UNLOCK|EVTHREAD_WRITE, \
- (q)->lock); \
+ _evthread_lock_fns.unlock(0, (q)->lock); \
} while (0)
#endif