Commit 6cfef6a8 authored by Etienne Bergeron's avatar Etienne Bergeron Committed by Commit Bot

Fix shutdown hangs related to DB_Impl

This CL is fixing a shutdown hangs caused by a condition
variable wait(...).

The code is scheduling a background task that will never be
executed which is causing a deadlock.
see: https://bugs.chromium.org/p/chromium/issues/detail?id=1086185#c24

Bug: 1086185
Change-Id: Ie401cd284d6af29f6c8c5da8ed085c72a81a0487
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2485635Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
Reviewed-by: default avatarVictor Costan <pwnall@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#818692}
parent 87336cbd
......@@ -1038,8 +1038,12 @@ class Thread : public base::PlatformThread::Delegate {
};
void ChromiumEnv::Schedule(ScheduleFunc* function, void* arg) {
// The BLOCK_SHUTDOWN is required to avoid shutdown hangs. The scheduled
// tasks may be blocking foreground threads waiting for their completions.
// see: https://crbug.com/1086185.
base::ThreadPool::PostTask(FROM_HERE,
{base::MayBlock(), base::WithBaseSyncPrimitives()},
{base::MayBlock(), base::WithBaseSyncPrimitives(),
base::TaskShutdownBehavior::BLOCK_SHUTDOWN},
base::BindOnce(function, arg));
}
......
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