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

Unified Diff: src/libplatform/default-platform.cc

Issue 1222203003: Fix data-race in default implementation of delayed task. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/libplatform/default-platform.cc
diff --git a/src/libplatform/default-platform.cc b/src/libplatform/default-platform.cc
index 2e13cc09042a896a62aec3525890f8d72a22eb3d..b41c5852a82119aaa074e6b74b7b5c47e957df97 100644
--- a/src/libplatform/default-platform.cc
+++ b/src/libplatform/default-platform.cc
@@ -149,6 +149,7 @@ void DefaultPlatform::CallOnForegroundThread(v8::Isolate* isolate, Task* task) {
void DefaultPlatform::CallDelayedOnForegroundThread(Isolate* isolate,
Task* task,
double delay_in_seconds) {
+ base::LockGuard<base::Mutex> guard(&lock_);
double deadline = MonotonicallyIncreasingTime() + delay_in_seconds;
main_thread_delayed_queue_[isolate].push(std::make_pair(deadline, task));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698