THRIFT-1361 Optional replacement of pthread by boost::thread
Patch: alexandre parenteau
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1178176 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/test/cpp/Makefile.am b/test/cpp/Makefile.am
index 6c62cfb..95574fc 100755
--- a/test/cpp/Makefile.am
+++ b/test/cpp/Makefile.am
@@ -95,9 +95,9 @@
INCLUDES = \
-I$(top_srcdir)/lib/cpp/src -Igen-cpp
-AM_CPPFLAGS = $(BOOST_CPPFLAGS)
+AM_CPPFLAGS = $(BOOST_CPPFLAGS) $(LIBEVENT_CPPFLAGS)
AM_CXXFLAGS = -Wall
-AM_LDFLAGS = $(BOOST_LDFLAGS)
+AM_LDFLAGS = $(BOOST_LDFLAGS) $(LIBEVENT_LDFLAGS)
clean-local:
$(RM) -r gen-cpp
@@ -109,5 +109,3 @@
src/StressTestNonBlocking.cpp \
realloc/realloc_test.c \
realloc/Makefile
-
-
diff --git a/test/cpp/src/StressTest.cpp b/test/cpp/src/StressTest.cpp
index 4892722..339e7d1 100755
--- a/test/cpp/src/StressTest.cpp
+++ b/test/cpp/src/StressTest.cpp
@@ -18,7 +18,7 @@
*/
#include <concurrency/ThreadManager.h>
-#include <concurrency/PosixThreadFactory.h>
+#include <concurrency/PlatformThreadFactory.h>
#include <concurrency/Monitor.h>
#include <concurrency/Util.h>
#include <concurrency/Mutex.h>
@@ -326,7 +326,7 @@
cerr << usage;
}
- shared_ptr<PosixThreadFactory> threadFactory = shared_ptr<PosixThreadFactory>(new PosixThreadFactory());
+ shared_ptr<PlatformThreadFactory> threadFactory = shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory());
// Dispatcher
shared_ptr<Server> serviceHandler(new Server());
diff --git a/test/cpp/src/StressTestNonBlocking.cpp b/test/cpp/src/StressTestNonBlocking.cpp
index 0d8bc3a..2ff507b 100755
--- a/test/cpp/src/StressTestNonBlocking.cpp
+++ b/test/cpp/src/StressTestNonBlocking.cpp
@@ -18,7 +18,7 @@
*/
#include <concurrency/ThreadManager.h>
-#include <concurrency/PosixThreadFactory.h>
+#include <concurrency/PlatformThreadFactory.h>
#include <concurrency/Monitor.h>
#include <concurrency/Util.h>
#include <concurrency/Mutex.h>
@@ -321,7 +321,7 @@
cerr << usage;
}
- shared_ptr<PosixThreadFactory> threadFactory = shared_ptr<PosixThreadFactory>(new PosixThreadFactory());
+ shared_ptr<PlatformThreadFactory> threadFactory = shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory());
// Dispatcher
shared_ptr<Server> serviceHandler(new Server());
diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp
index 9aed551..c1d6e07 100755
--- a/test/cpp/src/TestClient.cpp
+++ b/test/cpp/src/TestClient.cpp
@@ -46,8 +46,6 @@
using namespace thrift::test;
using namespace apache::thrift::async;
-using std::tr1::placeholders::_1;
-
//extern uint32_t g_socket_syscalls;
// Current time, microseconds since the epoch
@@ -86,7 +84,7 @@
delete client;
shared_ptr<TAsyncChannel> channel(new TEvhttpClientChannel(host, "/", host, port, base));
client = new ThriftTestCobClient(channel, protocolFactory);
- client->testString(tr1::bind(testString_clientReturn, host, port, base, protocolFactory, _1), "Test");
+ client->testString(tr1::bind(testString_clientReturn, host, port, base, protocolFactory, std::tr1::placeholders::_1), "Test");
} catch (TException& exn) {
cout << "Error: " << exn.what() << endl;
}
@@ -211,7 +209,7 @@
shared_ptr<TAsyncChannel> channel(new TEvhttpClientChannel(host.c_str(), "/", host.c_str(), port, base));
ThriftTestCobClient* client = new ThriftTestCobClient(channel, protocolFactory.get());
- client->testVoid(tr1::bind(testVoid_clientReturn, host.c_str(), port, base, protocolFactory.get(), _1));
+ client->testVoid(tr1::bind(testVoid_clientReturn, host.c_str(), port, base, protocolFactory.get(), std::tr1::placeholders::_1));
event_base_loop(base, 0);
return 0;
diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp
index 4afbef6..456577f 100755
--- a/test/cpp/src/TestServer.cpp
+++ b/test/cpp/src/TestServer.cpp
@@ -21,7 +21,7 @@
#include <inttypes.h>
#include <concurrency/ThreadManager.h>
-#include <concurrency/PosixThreadFactory.h>
+#include <concurrency/PlatformThreadFactory.h>
#include <protocol/TBinaryProtocol.h>
#include <protocol/TJSONProtocol.h>
#include <server/TSimpleServer.h>
@@ -641,8 +641,8 @@
shared_ptr<ThreadManager> threadManager =
ThreadManager::newSimpleThreadManager(workers);
- shared_ptr<PosixThreadFactory> threadFactory =
- shared_ptr<PosixThreadFactory>(new PosixThreadFactory());
+ shared_ptr<PlatformThreadFactory> threadFactory =
+ shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory());
threadManager->threadFactory(threadFactory);