optimize spinlock spin
This commit is contained in:
parent
8ae2fa6563
commit
c322fe4e1a
1 changed files with 1 additions and 1 deletions
|
|
@ -2,6 +2,6 @@
|
||||||
|
|
||||||
int pthread_spin_lock(pthread_spinlock_t *s)
|
int pthread_spin_lock(pthread_spinlock_t *s)
|
||||||
{
|
{
|
||||||
while (a_xchg(s, 1));
|
while (*s || a_xchg(s, 1));
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue