Commit e76072bf authored by Marja Hölttä's avatar Marja Hölttä Committed by Commit Bot

[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: 's avatarIgor Sheludko <ishell@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68632}
parent 71dd648f
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment