Sign in
fuchsia
/
fuchsia
/
83854f31e881f0f9aa2bd848a84a94e01fb09dd9
/
.
/
zircon
/
third_party
/
ulib
/
musl
/
pthread
/
pthread_spin_lock.c
blob: 64f663905641b5657cb7b06677da6dd80539e05d [
file
] [
log
] [
blame
]
#include
<errno.h>
#include
"atomic.h"
#include
"threads_impl.h"
int
pthread_spin_lock
(
pthread_spinlock_t
*
s
)
{
while
(
atomic_load
(
s
)
||
a_cas_shim
(
s
,
0
,
EBUSY
))
a_spin
();
return
0
;
}