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:
parent
fa7d113aec
commit
d202501199
@ -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));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user