3
0
Fork 0
forked from suyu/suyu

Merge pull request #6512 from ReinUsesLisp/wait-detached-stasks

common/detached_tasks: Wait for tasks before shutting down
This commit is contained in:
Mai M 2021-06-22 22:20:14 -04:00 committed by GitHub
commit d6b51e5e21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,8 @@ void DetachedTasks::WaitForAllTasks() {
} }
DetachedTasks::~DetachedTasks() { DetachedTasks::~DetachedTasks() {
WaitForAllTasks();
std::unique_lock lock{mutex}; std::unique_lock lock{mutex};
ASSERT(count == 0); ASSERT(count == 0);
instance = nullptr; instance = nullptr;