spinlock: prefer weak xchg when spinning
This commit is contained in:
parent
12d401b98b
commit
e1d87afe37
@ -39,7 +39,7 @@ spinlock::lock (void)
|
||||
{
|
||||
do {
|
||||
bool expected = false;
|
||||
if (held.compare_exchange_strong (expected, true))
|
||||
if (held.compare_exchange_weak (expected, true))
|
||||
return;
|
||||
|
||||
while (held)
|
||||
|
Loading…
Reference in New Issue
Block a user