projects
/
oweals
/
musl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
floating point environment, untested
[oweals/musl.git]
/
src
/
thread
/
pthread_spin_trylock.c
diff --git
a/src/thread/pthread_spin_trylock.c
b/src/thread/pthread_spin_trylock.c
index 1fc5f73c174ec890da1457bb8bd776f9e1fb3bc2..c12696b3010b332706d203faa7e16cad62433bca 100644
(file)
--- a/
src/thread/pthread_spin_trylock.c
+++ b/
src/thread/pthread_spin_trylock.c
@@
-2,6
+2,5
@@
int pthread_spin_trylock(pthread_spinlock_t *s)
{
- if (*s || a_xchg(s, 1)) return EBUSY;
- return 0;
+ return -a_xchg(s, 1) & EBUSY;
}