Fix data-race in default implementation of delayed task.

BUG=

Review URL: https://codereview.chromium.org/1222203003

Cr-Commit-Position: refs/heads/master@{#29458}
This commit is contained in:
ulan 2015-07-02 11:25:42 -07:00 committed by Commit bot
parent fa7d113aec
commit d202501199

View File

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