Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(752)

Unified Diff: src/execution.cc

Issue 1230303005: Signal a blocked futex if the isolate is interrupted; don't busy-wait (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix windows build Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/futex-emulation.h » ('j') | src/futex-emulation.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/execution.cc
diff --git a/src/execution.cc b/src/execution.cc
index 52cff2f7900eabe3b554724f3525f449f850a6ad..ce5022680cb16afc082ce98c49399acb147aa780 100644
--- a/src/execution.cc
+++ b/src/execution.cc
@@ -413,6 +413,15 @@ void StackGuard::RequestInterrupt(InterruptFlag flag) {
// Not intercepted. Set as active interrupt flag.
thread_local_.interrupt_flags_ |= flag;
set_interrupt_limits(access);
+
+ // If this isolate is waiting in a futex, notify it to wake up.
+ if (isolate_->futex_wait_list_node()->waiting()) {
+ // Release the execution lock to prevent potential deadlock due to lock
+ // order inversion with the futex lock.
+ ExecutionAccess::Unlock(isolate_);
+ isolate_->futex_wait_list_node()->NotifyWake();
+ ExecutionAccess::Lock(isolate_);
+ }
}
« no previous file with comments | « no previous file | src/futex-emulation.h » ('j') | src/futex-emulation.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698