[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:
Marja Hölttä 2020-06-26 12:27:40 +02:00 committed by Commit Bot
parent 71dd648fb7
commit e76072bf00

View File

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