Skip to content

Commit 31ad395

Browse files
committed
Merge branch 'fix/thread-pool-crush' into develop
2 parents 5182c87 + 88f5375 commit 31ad395

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/eventx/thread_pool.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,8 @@ void ThreadPool::threadProc(ThreadToken thread_token)
369369

370370
if (let_main_loop_join_me) {
371371
//! 则将线程取出来,交给main_loop去join(),然后delete
372+
std::unique_lock<std::mutex> lk(d_->lock);
373+
372374
auto t = d_->threads_cabinet.free(thread_token);
373375
TBOX_ASSERT(t != nullptr);
374376
d_->wp_loop->runInLoop(

0 commit comments

Comments
 (0)