spinlock: prefer weak xchg when spinning

This commit is contained in:
Danny Robson 2018-03-15 23:48:50 +11:00
parent 12d401b98b
commit e1d87afe37

View File

@ -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)