xref: /aosp_15_r20/external/musl/src/thread/lock_ptc.c (revision c9945492fdd68bbe62686c5b452b4dc1be3f8453)
1 #include <pthread.h>
2 
3 static pthread_rwlock_t lock = PTHREAD_RWLOCK_INITIALIZER;
4 
__inhibit_ptc()5 void __inhibit_ptc()
6 {
7 	pthread_rwlock_wrlock(&lock);
8 }
9 
__acquire_ptc()10 void __acquire_ptc()
11 {
12 	pthread_rwlock_rdlock(&lock);
13 }
14 
__release_ptc()15 void __release_ptc()
16 {
17 	pthread_rwlock_unlock(&lock);
18 }
19