Lines Matching defs:mutex

9 #include "include/liblockdep/mutex.h"
42 /* pthread mutex API */
45 extern int __pthread_mutex_init(pthread_mutex_t *mutex, const pthread_mutexattr_t *attr);
46 extern int __pthread_mutex_lock(pthread_mutex_t *mutex);
47 extern int __pthread_mutex_trylock(pthread_mutex_t *mutex);
48 extern int __pthread_mutex_unlock(pthread_mutex_t *mutex);
49 extern int __pthread_mutex_destroy(pthread_mutex_t *mutex);
57 static int (*ll_pthread_mutex_init)(pthread_mutex_t *mutex,
59 static int (*ll_pthread_mutex_lock)(pthread_mutex_t *mutex) = __pthread_mutex_lock;
60 static int (*ll_pthread_mutex_trylock)(pthread_mutex_t *mutex) = __pthread_mutex_trylock;
61 static int (*ll_pthread_mutex_unlock)(pthread_mutex_t *mutex) = __pthread_mutex_unlock;
62 static int (*ll_pthread_mutex_destroy)(pthread_mutex_t *mutex) = __pthread_mutex_destroy;
220 int pthread_mutex_init(pthread_mutex_t *mutex,
237 r = ll_pthread_mutex_init(mutex, attr);
244 __get_lock(mutex);
249 int pthread_mutex_lock(pthread_mutex_t *mutex)
255 lock_acquire(&__get_lock(mutex)->dep_map, 0, 0, 0, 1, NULL,
271 r = ll_pthread_mutex_lock(mutex);
273 lock_release(&__get_lock(mutex)->dep_map, (unsigned long)_RET_IP_);
278 int pthread_mutex_trylock(pthread_mutex_t *mutex)
284 lock_acquire(&__get_lock(mutex)->dep_map, 0, 1, 0, 1, NULL, (unsigned long)_RET_IP_);
285 r = ll_pthread_mutex_trylock(mutex);
287 lock_release(&__get_lock(mutex)->dep_map, (unsigned long)_RET_IP_);
292 int pthread_mutex_unlock(pthread_mutex_t *mutex)
298 lock_release(&__get_lock(mutex)->dep_map, (unsigned long)_RET_IP_);
304 r = ll_pthread_mutex_unlock(mutex);
306 lock_acquire(&__get_lock(mutex)->dep_map, 0, 0, 0, 1, NULL, (unsigned long)_RET_IP_);
311 int pthread_mutex_destroy(pthread_mutex_t *mutex)
320 debug_check_no_locks_freed(mutex, sizeof(*mutex));
321 __del_lock(__get_lock(mutex));
322 return ll_pthread_mutex_destroy(mutex);
325 /* This is the rwlock part, very similar to what happened with mutex above */