hc
2024-08-16 a24a44ff9ca902811b99aa9663d697cf452e08ef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef _PERF_RWSEM_H
#define _PERF_RWSEM_H
 
#include <pthread.h>
 
struct rw_semaphore {
   pthread_rwlock_t lock;
};
 
int init_rwsem(struct rw_semaphore *sem);
int exit_rwsem(struct rw_semaphore *sem);
 
int down_read(struct rw_semaphore *sem);
int up_read(struct rw_semaphore *sem);
 
int down_write(struct rw_semaphore *sem);
int up_write(struct rw_semaphore *sem);
 
#endif /* _PERF_RWSEM_H */