commit | 0a660ee285e4a4cbac8f702168c40fd4ef5495d1 | [log] [tgz] |
---|---|---|
author | James E. King, III <jking@apache.org> | Mon Feb 13 18:25:56 2017 -0500 |
committer | James E. King, III <jking@apache.org> | Mon Feb 13 18:25:56 2017 -0500 |
tree | 21d0db1be27bf7ad80e2e6d311e3c156f769104e | |
parent | b4c190b6ea960c20a420089b1431042e435c73e9 [diff] |
THRIFT-4084: only join threads if joinable Client: cpp Patch: Chris Grebeldinger <cgrebeld@gmail.com> This closes #1188
diff --git a/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp index 6adcb68..8afabf9 100644 --- a/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp +++ b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
@@ -61,7 +61,7 @@ } ~BoostThread() { - if (!detached_) { + if (!detached_ && thread_->joinable()) { try { join(); } catch (...) {
diff --git a/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp b/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp index 66c7e75..4fca8da 100644 --- a/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp +++ b/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
@@ -61,7 +61,7 @@ } ~StdThread() { - if (!detached_) { + if (!detached_ && thread_->joinable()) { try { join(); } catch (...) {