Commit 1bcf51bb authored by Dominik Inführ's avatar Dominik Inführ Committed by V8 LUCI CQ

[libplatform] Stop workers before destroying task queue

WorkerThreads access the queue to get new tasks, that's why all of
them need to stop before we can destroy the queue.

This hopefully fixes the linked race/crash since I can't reproduce
this locally.

Bug: v8:12914
Change-Id: Icbfd462f106a4a1f0bbd525f0b7f342e9857a539
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3672421Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80841}
parent 7c4461ad
......@@ -63,8 +63,10 @@ class V8_PLATFORM_EXPORT DefaultWorkerThreadsTaskRunner
bool terminated_ = false;
base::Mutex lock_;
DelayedTaskQueue queue_;
std::vector<std::unique_ptr<WorkerThread>> thread_pool_;
// Worker threads access this queue, so we can only destroy it after all
// workers stopped.
DelayedTaskQueue queue_;
TimeFunction time_function_;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment