18c2ecf20Sopenharmony_ci#ifndef _PERF_RWSEM_H 28c2ecf20Sopenharmony_ci#define _PERF_RWSEM_H 38c2ecf20Sopenharmony_ci 48c2ecf20Sopenharmony_ci#include <pthread.h> 58c2ecf20Sopenharmony_ci 68c2ecf20Sopenharmony_cistruct rw_semaphore { 78c2ecf20Sopenharmony_ci pthread_rwlock_t lock; 88c2ecf20Sopenharmony_ci}; 98c2ecf20Sopenharmony_ci 108c2ecf20Sopenharmony_ciint init_rwsem(struct rw_semaphore *sem); 118c2ecf20Sopenharmony_ciint exit_rwsem(struct rw_semaphore *sem); 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ciint down_read(struct rw_semaphore *sem); 148c2ecf20Sopenharmony_ciint up_read(struct rw_semaphore *sem); 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ciint down_write(struct rw_semaphore *sem); 178c2ecf20Sopenharmony_ciint up_write(struct rw_semaphore *sem); 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci#endif /* _PERF_RWSEM_H */ 20