Lines Matching refs:sem
9 int init_rwsem(struct rw_semaphore *sem) in init_rwsem() argument
12 mutex_init(&sem->mtx); in init_rwsem()
15 return pthread_rwlock_init(&sem->lock, NULL); in init_rwsem()
19 int exit_rwsem(struct rw_semaphore *sem) in exit_rwsem() argument
22 mutex_destroy(&sem->mtx); in exit_rwsem()
25 return pthread_rwlock_destroy(&sem->lock); in exit_rwsem()
29 int down_read(struct rw_semaphore *sem) in down_read() argument
32 mutex_lock(&sem->mtx); in down_read()
35 return perf_singlethreaded ? 0 : pthread_rwlock_rdlock(&sem->lock); in down_read()
39 int up_read(struct rw_semaphore *sem) in up_read() argument
42 mutex_unlock(&sem->mtx); in up_read()
45 return perf_singlethreaded ? 0 : pthread_rwlock_unlock(&sem->lock); in up_read()
49 int down_write(struct rw_semaphore *sem) in down_write() argument
52 mutex_lock(&sem->mtx); in down_write()
55 return perf_singlethreaded ? 0 : pthread_rwlock_wrlock(&sem->lock); in down_write()
59 int up_write(struct rw_semaphore *sem) in up_write() argument
62 mutex_unlock(&sem->mtx); in up_write()
65 return perf_singlethreaded ? 0 : pthread_rwlock_unlock(&sem->lock); in up_write()