mirror of
https://github.com/fluencelabs/musl
synced 2025-06-29 22:51:55 +00:00
optimize contended case for pthread_spin_trylock
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user