Lines Matching refs:sem
11 static inline int init_rwsem(struct rw_semaphore *sem) in init_rwsem() argument
13 return pthread_rwlock_init(&sem->lock, NULL); in init_rwsem()
16 static inline int exit_rwsem(struct rw_semaphore *sem) in exit_rwsem() argument
18 return pthread_rwlock_destroy(&sem->lock); in exit_rwsem()
21 static inline int down_read(struct rw_semaphore *sem) in down_read() argument
23 return pthread_rwlock_rdlock(&sem->lock); in down_read()
26 static inline int up_read(struct rw_semaphore *sem) in up_read() argument
28 return pthread_rwlock_unlock(&sem->lock); in up_read()
31 static inline int down_write(struct rw_semaphore *sem) in down_write() argument
33 return pthread_rwlock_wrlock(&sem->lock); in down_write()
36 static inline int up_write(struct rw_semaphore *sem) in up_write() argument
38 return pthread_rwlock_unlock(&sem->lock); in up_write()
41 #define down_read_nested(sem, subclass) down_read(sem) argument
42 #define down_write_nested(sem, subclass) down_write(sem) argument