revert some more spin optimizations that turned out to be pessimizations
This commit is contained in:
parent
4cc78719dd
commit
4106cdcd2d
3 changed files with 3 additions and 4 deletions
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
int pthread_spin_lock(pthread_spinlock_t *s)
|
||||
{
|
||||
while (a_xchg(s, 1));
|
||||
while (a_xchg(s, 1)) a_spin();
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,5 @@
|
|||
|
||||
int pthread_spin_trylock(pthread_spinlock_t *s)
|
||||
{
|
||||
if (*s || a_xchg(s, 1)) return EBUSY;
|
||||
return 0;
|
||||
return -a_xchg(s, 1) & EBUSY;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue