Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
fix Resource deadlock avoided error
  • Loading branch information
olegabr committed Feb 13, 2018
commit 01971e2770f91374f85b8b066179d9a05ebf2a44
4 changes: 3 additions & 1 deletion boost/network/protocol/http/client/async_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ struct async_client
void wait_complete() {
sentinel_.reset();
if (lifetime_thread_.get()) {
lifetime_thread_->join();
if (lifetime_thread_->joinable() && lifetime_thread_->get_id() != boost::this_thread::get_id()) {
lifetime_thread_->join();
}
lifetime_thread_.reset();
}
}
Expand Down
2 changes: 1 addition & 1 deletion boost/network/utils/thread_group.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class thread_group {
std::unique_lock<std::mutex> guard(m);

for (auto &thread : threads) {
if (thread->joinable()) {
if (thread->joinable() && thread->get_id() != boost::this_thread::get_id()) {
thread->join();
}
}
Expand Down