Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions muduo/net/EventLoopThread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ EventLoopThread::~EventLoopThread()
// still a tiny chance to call destructed object, if threadFunc exits just now.
// but when EventLoopThread destructs, usually programming is exiting anyway.
loop_->quit();
}
// In case `threadFunc` finished before destructing.
if (thread_.started()) {
thread_.join();
}
}
Expand Down