Sign in
fuchsia
/
fuchsia
/
refs/heads/main
/
.
/
zircon
/
third_party
/
ulib
/
musl
/
pthread
/
pthread_rwlock_trywrlock.c
blob: ac4dd6d0060769b6efeb178189c4abfa6b58f073 [
file
] [
log
] [
blame
]
#include
"atomic.h"
#include
"threads_impl.h"
int
pthread_rwlock_trywrlock
(
pthread_rwlock_t
*
rw
)
{
if
(
a_cas_shim
(&
rw
->
_rw_lock
,
PTHREAD_MUTEX_RWLOCK_UNLOCKED
,
PTHREAD_MUTEX_RWLOCK_LOCKED_FOR_WR
))
{
return
EBUSY
;
}
return
0
;
}