Lines Matching full:lock

50 /* Global function pointers to lock-related functions. NULL if locking isn't
65 * running a given event_base's loop. Requires lock. */
72 * thread. Requires lock. */
78 /** Allocate a new lock, and store it in lockvar, a void*. Sets lockvar to
84 /** Free a given lock, if it is present and locking is enabled. */
92 /** Acquire a lock. */
96 evthread_lock_fns_.lock(mode, lockvar); \
99 /** Release a lock */
116 /** Lock an event_base, if it is set up for locking. Acquires the lock
127 /** If lock debugging is enabled, and lock is non-null, assert that 'lock' is
129 #define EVLOCK_ASSERT_LOCKED(lock) \ argument
131 if ((lock) && evthread_lock_debugging_enabled_) { \
132 EVUTIL_ASSERT(evthread_is_debug_lock_held_(lock)); \
136 /** Try to grab the lock for 'lockvar' without blocking, and return 1 if we
138 static inline int EVLOCK_TRY_LOCK_(void *lock);
140 EVLOCK_TRY_LOCK_(void *lock) in EVLOCK_TRY_LOCK_() argument
142 if (lock && evthread_lock_fns_.lock) { in EVLOCK_TRY_LOCK_()
143 int r = evthread_lock_fns_.lock(EVTHREAD_TRY, lock); in EVLOCK_TRY_LOCK_()
147 * of course we count as having the lock. */ in EVLOCK_TRY_LOCK_()
171 * holding 'lock'. The lock will be released until the condition is
174 #define EVTHREAD_COND_WAIT(cond, lock) \ argument
175 ( (cond) ? evthread_cond_fns_.wait_condition((cond), (lock), NULL) : 0 )
178 #define EVTHREAD_COND_WAIT_TIMED(cond, lock, tv) \ argument
179 ( (cond) ? evthread_cond_fns_.wait_condition((cond), (lock), (tv)) : 0 )
183 (evthread_lock_fns_.lock != NULL)
193 void evthreadimpl_lock_free_(void *lock, unsigned locktype);
195 int evthreadimpl_lock_lock_(unsigned mode, void *lock);
197 int evthreadimpl_lock_unlock_(unsigned mode, void *lock);
205 int evthreadimpl_cond_wait_(void *cond, void *lock, const struct timeval *tv);
225 /** Acquire a lock. */
232 /** Release a lock */
239 /** Lock an event_base, if it is set up for locking. Acquires the lock
250 /** If lock debugging is enabled, and lock is non-null, assert that 'lock' is
252 #define EVLOCK_ASSERT_LOCKED(lock) \ argument
254 if ((lock) && evthreadimpl_is_lock_debugging_enabled_()) { \
255 EVUTIL_ASSERT(evthread_is_debug_lock_held_(lock)); \
259 /** Try to grab the lock for 'lockvar' without blocking, and return 1 if we
261 static inline int EVLOCK_TRY_LOCK_(void *lock);
263 EVLOCK_TRY_LOCK_(void *lock) in EVLOCK_TRY_LOCK_() argument
265 if (lock) { in EVLOCK_TRY_LOCK_()
266 int r = evthreadimpl_lock_lock_(EVTHREAD_TRY, lock); in EVLOCK_TRY_LOCK_()
270 * of course we count as having the lock. */ in EVLOCK_TRY_LOCK_()
293 * holding 'lock'. The lock will be released until the condition is
296 #define EVTHREAD_COND_WAIT(cond, lock) \ argument
297 ( (cond) ? evthreadimpl_cond_wait_((cond), (lock), NULL) : 0 )
300 #define EVTHREAD_COND_WAIT_TIMED(cond, lock, tv) \ argument
301 ( (cond) ? evthreadimpl_cond_wait_((cond), (lock), (tv)) : 0 )
319 #define EVBASE_ACQUIRE_LOCK(base, lock) EVUTIL_NIL_STMT_ argument
320 #define EVBASE_RELEASE_LOCK(base, lock) EVUTIL_NIL_STMT_ argument
321 #define EVLOCK_ASSERT_LOCKED(lock) EVUTIL_NIL_STMT_ argument
323 #define EVLOCK_TRY_LOCK_(lock) 1 argument
329 #define EVTHREAD_COND_WAIT(cond, lock) EVUTIL_NIL_STMT_ argument
330 #define EVTHREAD_COND_WAIT_TIMED(cond, lock, howlong) EVUTIL_NIL_STMT_ argument
336 /* This code is shared between both lock impls */
371 int evthread_is_debug_lock_held_(void *lock);
372 void *evthread_debug_get_real_lock_(void *lock);