musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
diff options
context:
space:
mode:
Diffstat
-rw-r--r--src/thread/pthread_spin_trylock.c 3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/thread/pthread_spin_trylock.c b/src/thread/pthread_spin_trylock.c
index c12696b3..1fc5f73c 100644
--- a/src/thread/pthread_spin_trylock.c
+++ b/src/thread/pthread_spin_trylock.c
@@ -2,5 +2,6 @@
int pthread_spin_trylock(pthread_spinlock_t *s)
{
- return -a_xchg(s, 1) & EBUSY;
+ if (*s || a_xchg(s, 1)) return EBUSY;
+ return 0;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月26日 04:23:26 +0000

AltStyle によって変換されたページ (->オリジナル) /