[futex emulation layer] Cast to atomics before accessing shared memory
It's actually not an atomic variable, just raw memory, so this is technically not correct. However, the expert advice is to do this until atomic_ref is available. Change-Id: I4b74aa7123ed6ffeb2a06800c35b03e428861e80 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2270162 Commit-Queue: Igor Sheludko <ishell@chromium.org> Reviewed-by: Igor Sheludko <ishell@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#68632}
This commit is contained in:
parent
71dd648fb7
commit
e76072bf00
@ -205,9 +205,9 @@ Object FutexEmulation::Wait(Isolate* isolate,
|
||||
// still holding the lock).
|
||||
ResetWaitingOnScopeExit reset_waiting(node);
|
||||
|
||||
T* p = reinterpret_cast<T*>(
|
||||
std::atomic<T>* p = reinterpret_cast<std::atomic<T>*>(
|
||||
static_cast<int8_t*>(backing_store->buffer_start()) + addr);
|
||||
if (*p != value) {
|
||||
if (p->load() != value) {
|
||||
result = handle(Smi::FromInt(WaitReturnValue::kNotEqual), isolate);
|
||||
callback_result = AtomicsWaitEvent::kNotEqual;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user