Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf240bf

Browse files
olegabrdeanberris
authored andcommitted
fix Resource deadlock avoided error (#817)
* fix Resource deadlock avoided error* fix boost -> std
1 parentf94635c commitcf240bf

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

‎boost/network/protocol/http/client/async_impl.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ struct async_client
7474
voidwait_complete() {
7575
sentinel_.reset();
7676
if (lifetime_thread_.get()) {
77-
lifetime_thread_->join();
77+
if (lifetime_thread_->joinable() && lifetime_thread_->get_id() !=std::this_thread::get_id()) {
78+
lifetime_thread_->join();
79+
}
7880
lifetime_thread_.reset();
7981
}
8082
}

‎boost/network/utils/thread_group.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class thread_group {
5555
std::unique_lock<std::mutex>guard(m);
5656

5757
for (auto &thread : threads) {
58-
if (thread->joinable()) {
58+
if (thread->joinable() && thread->get_id() !=std::this_thread::get_id()) {
5959
thread->join();
6060
}
6161
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp