mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-08 07:42:09 +03:00
optimize contended case for pthread_spin_trylock
This commit is contained in:
parent
c322fe4e1a
commit
b8b85a4272
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user