diff options
author | cyy <cyyever@outlook.com> | 2019-01-11 22:13:12 +0800 |
---|---|---|
committer | James E. King III <jking@apache.org> | 2019-01-11 09:13:12 -0500 |
commit | ca8af9b48f9e62edc57c4a233c6377144214ef5a (patch) | |
tree | 1ad3761595642b938c384b459666b89be68821cf /test/cpp | |
parent | c9ac8d2953a4806cc93aa4ff2e700623ecad980c (diff) | |
download | thrift-ca8af9b48f9e62edc57c4a233c6377144214ef5a.tar.gz |
THRIFT-4730: remove pthread code and refactor, ending up with just ThreadFactory
Diffstat (limited to 'test/cpp')
-rw-r--r-- | test/cpp/src/StressTest.cpp | 6 | ||||
-rw-r--r-- | test/cpp/src/StressTestNonBlocking.cpp | 6 | ||||
-rw-r--r-- | test/cpp/src/TestServer.cpp | 8 |
3 files changed, 10 insertions, 10 deletions
diff --git a/test/cpp/src/StressTest.cpp b/test/cpp/src/StressTest.cpp index 585f89a9e..f4c281c7f 100644 --- a/test/cpp/src/StressTest.cpp +++ b/test/cpp/src/StressTest.cpp @@ -18,7 +18,7 @@ */ #include <thrift/concurrency/ThreadManager.h> -#include <thrift/concurrency/PlatformThreadFactory.h> +#include <thrift/concurrency/ThreadFactory.h> #include <thrift/concurrency/Monitor.h> #include <thrift/concurrency/Util.h> #include <thrift/concurrency/Mutex.h> @@ -390,8 +390,8 @@ int main(int argc, char** argv) { cerr << usage.str(); } - std::shared_ptr<PlatformThreadFactory> threadFactory - = std::shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory()); + std::shared_ptr<ThreadFactory> threadFactory + = std::shared_ptr<ThreadFactory>(new ThreadFactory()); // Dispatcher std::shared_ptr<Server> serviceHandler(new Server()); diff --git a/test/cpp/src/StressTestNonBlocking.cpp b/test/cpp/src/StressTestNonBlocking.cpp index 1d3ed732b..5f0b293b9 100644 --- a/test/cpp/src/StressTestNonBlocking.cpp +++ b/test/cpp/src/StressTestNonBlocking.cpp @@ -18,7 +18,7 @@ */ #include <thrift/concurrency/ThreadManager.h> -#include <thrift/concurrency/PlatformThreadFactory.h> +#include <thrift/concurrency/ThreadFactory.h> #include <thrift/concurrency/Monitor.h> #include <thrift/concurrency/Util.h> #include <thrift/concurrency/Mutex.h> @@ -343,8 +343,8 @@ int main(int argc, char** argv) { cerr << usage.str(); } - std::shared_ptr<PlatformThreadFactory> threadFactory - = std::shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory()); + std::shared_ptr<ThreadFactory> threadFactory + = std::shared_ptr<ThreadFactory>(new ThreadFactory()); // Dispatcher std::shared_ptr<Server> serviceHandler(new Server()); diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp index 622201766..410662819 100644 --- a/test/cpp/src/TestServer.cpp +++ b/test/cpp/src/TestServer.cpp @@ -20,7 +20,7 @@ #include <thrift/async/TAsyncBufferProcessor.h> #include <thrift/async/TAsyncProtocolProcessor.h> #include <thrift/async/TEvhttpServer.h> -#include <thrift/concurrency/PlatformThreadFactory.h> +#include <thrift/concurrency/ThreadFactory.h> #include <thrift/concurrency/ThreadManager.h> #include <thrift/processor/TMultiplexedProcessor.h> #include <thrift/protocol/TBinaryProtocol.h> @@ -770,8 +770,8 @@ int main(int argc, char** argv) { server.reset(new TSimpleServer(testProcessor, serverSocket, transportFactory, protocolFactory)); } else if (server_type == "thread-pool") { - std::shared_ptr<PlatformThreadFactory> threadFactory - = std::shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory()); + std::shared_ptr<ThreadFactory> threadFactory + = std::shared_ptr<ThreadFactory>(new ThreadFactory()); std::shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(workers); threadManager->threadFactory(threadFactory); @@ -817,7 +817,7 @@ int main(int argc, char** argv) { server->setOutputProtocolFactory(std::shared_ptr<TProtocolFactory>()); } - apache::thrift::concurrency::PlatformThreadFactory factory; + apache::thrift::concurrency::ThreadFactory factory; factory.setDetached(false); std::shared_ptr<apache::thrift::concurrency::Runnable> serverThreadRunner(server); std::shared_ptr<apache::thrift::concurrency::Thread> thread |