Home | History | Annotate | Download | only in include

Lines Matching full:mutex

243 #error "No base mutex API is available."
248 * Create new mutex.
249 * @param mutex pointer to the mutex
252 #define MHD_mutex_create_(mutex) \
253 ((0 == pthread_mutex_init ((mutex), NULL)) ? MHD_YES : MHD_NO)
256 * Create new mutex.
257 * @param mutex pointer to mutex
260 #define MHD_mutex_create_(mutex) \
261 ((NULL != (mutex) && 0 != InitializeCriticalSectionAndSpinCount((mutex),2000)) ? MHD_YES : MHD_NO)
266 * Destroy previously created mutex.
267 * @param mutex pointer to mutex
270 #define MHD_mutex_destroy_(mutex) \
271 ((0 == pthread_mutex_destroy ((mutex))) ? MHD_YES : MHD_NO)
274 * Destroy previously created mutex.
275 * @param mutex pointer to mutex
278 #define MHD_mutex_destroy_(mutex) \
279 ((NULL != (mutex)) ? (DeleteCriticalSection(mutex), MHD_YES) : MHD_NO)
284 * Acquire lock on previously created mutex.
285 * If mutex was already locked by other thread, function
286 * blocks until mutex becomes available.
287 * @param mutex pointer to mutex
290 #define MHD_mutex_lock_(mutex) \
291 ((0 == pthread_mutex_lock((mutex))) ? MHD_YES : MHD_NO)
294 * Acquire lock on previously created mutex.
295 * If mutex was already locked by other thread, function
296 * blocks until mutex becomes available.
297 * @param mutex pointer to mutex
300 #define MHD_mutex_lock_(mutex) \
301 ((NULL != (mutex)) ? (EnterCriticalSection((mutex)), MHD_YES) : MHD_NO)
306 * Try to acquire lock on previously created mutex.
308 * @param mutex pointer to mutex
309 * @return #MHD_YES if mutex is locked, #MHD_NO if
310 * mutex was not locked.
312 #define MHD_mutex_trylock_(mutex) \
313 ((0 == pthread_mutex_trylock((mutex))) ? MHD_YES : MHD_NO)
316 * Try to acquire lock on previously created mutex.
318 * @param mutex pointer to mutex
319 * @return #MHD_YES if mutex is locked, #MHD_NO if
320 * mutex was not locked.
322 #define MHD_mutex_trylock_(mutex) \
323 ((NULL != (mutex) && 0 != TryEnterCriticalSection ((mutex))) ? MHD_YES : MHD_NO)
328 * Unlock previously created and locked mutex.
329 * @param mutex pointer to mutex
332 #define MHD_mutex_unlock_(mutex) \
333 ((0 == pthread_mutex_unlock((mutex))) ? MHD_YES : MHD_NO)
336 * Unlock previously created and locked mutex.
337 * @param mutex pointer to mutex
340 #define MHD_mutex_unlock_(mutex) \
341 ((NULL != (mutex)) ? (LeaveCriticalSection((mutex)), MHD_YES) : MHD_NO)