diff options
Diffstat (limited to 'libc-top-half/musl/src/thread/pthread_rwlock_trywrlock.c')
-rw-r--r-- | libc-top-half/musl/src/thread/pthread_rwlock_trywrlock.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libc-top-half/musl/src/thread/pthread_rwlock_trywrlock.c b/libc-top-half/musl/src/thread/pthread_rwlock_trywrlock.c new file mode 100644 index 0000000..64d9d31 --- /dev/null +++ b/libc-top-half/musl/src/thread/pthread_rwlock_trywrlock.c @@ -0,0 +1,9 @@ +#include "pthread_impl.h" + +int __pthread_rwlock_trywrlock(pthread_rwlock_t *rw) +{ + if (a_cas(&rw->_rw_lock, 0, 0x7fffffff)) return EBUSY; + return 0; +} + +weak_alias(__pthread_rwlock_trywrlock, pthread_rwlock_trywrlock); |