Skip to content

Commit 6c12977

Browse files
committed
worker_lock.lock() in WorkPool::~impl() to ensure destruction order (#1026)
1 parent bc27649 commit 6c12977

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

thread/workerpool.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,16 @@ class WorkPool::impl {
5757
~impl() {
5858
for (auto num = vcpus.size(); num; --num) enqueue({});
5959
for (auto &worker : owned_std_threads) worker.join();
60+
<<<<<<< HEAD
6061
if (likely(CURRENT)) {
6162
while (vcpus.size()) thread_yield();
6263
} else {
6364
while (vcpus.size()) std::this_thread::yield();
6465
}
66+
=======
67+
while (vcpus.size()) std::this_thread::yield();
68+
worker_lock.lock();
69+
>>>>>>> c4118ca (worker_lock.lock() in WorkPool::~impl() to ensure destruction order (#1026))
6570
}
6671

6772
void enqueue(Delegate<void> call, AutoContext = {}) {

0 commit comments

Comments
 (0)