summaryrefslogtreecommitdiff
path: root/evthread-internal.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-05-13 11:24:07 -0400
committerNick Mathewson <nickm@torproject.org>2010-05-13 15:40:43 -0400
commit218a3c372c9eb0fab8325833342fa7e8e0ce8e86 (patch)
treeeba583c3d54738ce0479bb3804a1a96db775a04c /evthread-internal.h
parentfdfc3fc502bf04b2cedf0b9a812e52af315e32b7 (diff)
downloadlibevent-218a3c372c9eb0fab8325833342fa7e8e0ce8e86.tar.gz
Do not check that event_base is set in EVBASE_ACQUIRE_LOCK
In every place that we call EVBASE_ACQUIRE_LOCK, the base is either set, or must be set, so the test is redundant.
Diffstat (limited to 'evthread-internal.h')
-rw-r--r--evthread-internal.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/evthread-internal.h b/evthread-internal.h
index 620328e3..b2989b92 100644
--- a/evthread-internal.h
+++ b/evthread-internal.h
@@ -43,10 +43,6 @@ extern struct evthread_lock_callbacks _evthread_lock_fns;
extern unsigned long (*_evthread_id_fn)(void);
extern int _evthread_lock_debugging_enabled;
-/** True iff the given event_base is set up to use locking */
-#define EVBASE_USING_LOCKS(base) \
- (base != NULL && (base)->th_base_lock != NULL)
-
/** Return the ID of the current thread, or 1 if threading isn't enabled. */
#define EVTHREAD_GET_ID() \
(_evthread_id_fn ? _evthread_id_fn() : 1)
@@ -122,14 +118,12 @@ extern int _evthread_lock_debugging_enabled;
/** Lock an event_base, if it is set up for locking. Acquires the lock
in the base structure whose field is named 'lockvar'. */
#define EVBASE_ACQUIRE_LOCK(base, lockvar) do { \
- if (EVBASE_USING_LOCKS(base)) \
- _evthread_lock_fns.lock(0, (base)->lockvar); \
+ EVLOCK_LOCK((base)->lockvar, 0); \
} while (0)
/** Unlock an event_base, if it is set up for locking. */
#define EVBASE_RELEASE_LOCK(base, lockvar) do { \
- if (EVBASE_USING_LOCKS(base)) \
- _evthread_lock_fns.unlock(0, (base)->lockvar); \
+ EVLOCK_UNLOCK((base)->lockvar, 0); \
} while (0)
/** If lock debugging is enabled, and lock is non-null, assert that 'lock' is