Thrift-1442: TNonblockingServer: Refactor to allow multiple IO Threads
Client: cpp
Patch: Dave Watson
Ads multiple IO threads to TNonblocking Server
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1210737 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/concurrency/PosixThreadFactory.cpp b/lib/cpp/src/concurrency/PosixThreadFactory.cpp
index 70204f1..6924aa6 100644
--- a/lib/cpp/src/concurrency/PosixThreadFactory.cpp
+++ b/lib/cpp/src/concurrency/PosixThreadFactory.cpp
@@ -156,7 +156,13 @@
cause the process to run out of thread resources.
We're beyond the point of throwing an exception. Not clear how
best to handle this. */
- detached_ = pthread_join(pthread_, &ignore) == 0;
+ int res = pthread_join(pthread_, &ignore);
+ detached_ = (res == 0);
+ if (res != 0) {
+ GlobalOutput.printf("PthreadThread::join(): fail with code %d", res);
+ }
+ } else {
+ GlobalOutput.printf("PthreadThread::join(): detached thread");
}
}