Lines Matching refs:rwlock
64 /* pthread rwlock API */
67 extern int __pthread_rwlock_init(pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr);
68 extern int __pthread_rwlock_destroy(pthread_rwlock_t *rwlock);
69 extern int __pthread_rwlock_wrlock(pthread_rwlock_t *rwlock);
70 extern int __pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock);
71 extern int __pthread_rwlock_rdlock(pthread_rwlock_t *rwlock);
72 extern int __pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock);
73 extern int __pthread_rwlock_unlock(pthread_rwlock_t *rwlock);
84 static int (*ll_pthread_rwlock_init)(pthread_rwlock_t *rwlock,
86 static int (*ll_pthread_rwlock_destroy)(pthread_rwlock_t *rwlock) = __pthread_rwlock_destroy;
87 static int (*ll_pthread_rwlock_rdlock)(pthread_rwlock_t *rwlock) = __pthread_rwlock_rdlock;
88 static int (*ll_pthread_rwlock_tryrdlock)(pthread_rwlock_t *rwlock) = __pthread_rwlock_tryrdlock;
89 static int (*ll_pthread_rwlock_trywrlock)(pthread_rwlock_t *rwlock) = __pthread_rwlock_trywrlock;
90 static int (*ll_pthread_rwlock_wrlock)(pthread_rwlock_t *rwlock) = __pthread_rwlock_wrlock;
91 static int (*ll_pthread_rwlock_unlock)(pthread_rwlock_t *rwlock) = __pthread_rwlock_unlock;
325 /* This is the rwlock part, very similar to what happened with mutex above */
326 int pthread_rwlock_init(pthread_rwlock_t *rwlock,
333 r = ll_pthread_rwlock_init(rwlock, attr);
335 __get_lock(rwlock);
340 int pthread_rwlock_destroy(pthread_rwlock_t *rwlock)
344 debug_check_no_locks_freed(rwlock, sizeof(*rwlock));
345 __del_lock(__get_lock(rwlock));
346 return ll_pthread_rwlock_destroy(rwlock);
349 int pthread_rwlock_rdlock(pthread_rwlock_t *rwlock)
355 lock_acquire(&__get_lock(rwlock)->dep_map, 0, 0, 2, 1, NULL, (unsigned long)_RET_IP_);
356 r = ll_pthread_rwlock_rdlock(rwlock);
358 lock_release(&__get_lock(rwlock)->dep_map, (unsigned long)_RET_IP_);
363 int pthread_rwlock_tryrdlock(pthread_rwlock_t *rwlock)
369 lock_acquire(&__get_lock(rwlock)->dep_map, 0, 1, 2, 1, NULL, (unsigned long)_RET_IP_);
370 r = ll_pthread_rwlock_tryrdlock(rwlock);
372 lock_release(&__get_lock(rwlock)->dep_map, (unsigned long)_RET_IP_);
377 int pthread_rwlock_trywrlock(pthread_rwlock_t *rwlock)
383 lock_acquire(&__get_lock(rwlock)->dep_map, 0, 1, 0, 1, NULL, (unsigned long)_RET_IP_);
384 r = ll_pthread_rwlock_trywrlock(rwlock);
386 lock_release(&__get_lock(rwlock)->dep_map, (unsigned long)_RET_IP_);
391 int pthread_rwlock_wrlock(pthread_rwlock_t *rwlock)
397 lock_acquire(&__get_lock(rwlock)->dep_map, 0, 0, 0, 1, NULL, (unsigned long)_RET_IP_);
398 r = ll_pthread_rwlock_wrlock(rwlock);
400 lock_release(&__get_lock(rwlock)->dep_map, (unsigned long)_RET_IP_);
405 int pthread_rwlock_unlock(pthread_rwlock_t *rwlock)
411 lock_release(&__get_lock(rwlock)->dep_map, (unsigned long)_RET_IP_);
412 r = ll_pthread_rwlock_unlock(rwlock);
414 lock_acquire(&__get_lock(rwlock)->dep_map, 0, 0, 0, 1, NULL, (unsigned long)_RET_IP_);