Reviewers: Hannes Payer,
Message:
PTAL
Description:
Fix data-race in default implementation of delayed task.
BUG=
Please review this at https://codereview.chromium.org/1222203003/
Base URL: https://chromium.googlesource.com/v8/v8.git@master
Affected files (+1, -0 lines):
M src/libplatform/default-platform.cc
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));
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.