Bug 1202367 - reinitialize expected value in CAS loop. patch=hev, r=sstangl, push=lth

This commit is contained in:
Lars T Hansen 2015-09-09 08:50:50 +02:00
parent 51c018eec2
commit 0163e6d77f

View File

@ -183,8 +183,10 @@ js::jit::RegionLock::acquire(void* addr)
# else
uint32_t zero = 0;
uint32_t one = 1;
while (!__atomic_compare_exchange(&spinlock, &zero, &one, false, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE))
while (!__atomic_compare_exchange(&spinlock, &zero, &one, false, __ATOMIC_ACQUIRE, __ATOMIC_ACQUIRE)) {
zero = 0;
continue;
}
# endif
}