^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) #ifndef _PERF_RWSEM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #define _PERF_RWSEM_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) #include <pthread.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) struct rw_semaphore {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) pthread_rwlock_t lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) int init_rwsem(struct rw_semaphore *sem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) int exit_rwsem(struct rw_semaphore *sem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) int down_read(struct rw_semaphore *sem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) int up_read(struct rw_semaphore *sem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) int down_write(struct rw_semaphore *sem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) int up_write(struct rw_semaphore *sem);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #endif /* _PERF_RWSEM_H */