projects
/
oweals
/
musl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
minor optimization to pthread_spin_trylock
[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 59de695ddad9ebb4ad941574681829513fe321db..5284fdac24d4ae70eb06242131dff16a33c61d90 100644
(file)
--- a/
src/thread/pthread_spin_trylock.c
+++ b/
src/thread/pthread_spin_trylock.c
@@
-1,6
+1,7
@@
#include "pthread_impl.h"
+#include <errno.h>
int pthread_spin_trylock(pthread_spinlock_t *s)
{
- return
-a_swap(s, 1) & EBUSY
;
+ return
a_cas(s, 0, EBUSY)
;
}