From aea8bfe0f0c0544fd59819d9696747ecaeacb4f7 Mon Sep 17 00:00:00 2001 From: Ben Craig Date: Fri, 27 Sep 2013 10:44:54 -0500 Subject: [PATCH] THRIFT-2139: MSVC 2012 Error - Cannot compile due to BoostThreadFactory Client: cpp Patch: Alex Loukissas --- lib/cpp/libthrift.vcxproj | 2 ++ lib/cpp/libthrift.vcxproj.filters | 6 ++++++ lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp | 4 ++++ lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp | 4 ++++ 4 files changed, 16 insertions(+) diff --git a/lib/cpp/libthrift.vcxproj b/lib/cpp/libthrift.vcxproj index e9990a5a..80ad22ca 100644 --- a/lib/cpp/libthrift.vcxproj +++ b/lib/cpp/libthrift.vcxproj @@ -39,6 +39,7 @@ + @@ -87,6 +88,7 @@ + diff --git a/lib/cpp/libthrift.vcxproj.filters b/lib/cpp/libthrift.vcxproj.filters index 3922988f..ba21a83f 100644 --- a/lib/cpp/libthrift.vcxproj.filters +++ b/lib/cpp/libthrift.vcxproj.filters @@ -93,6 +93,9 @@ concurrency + + concurrency + windows @@ -212,6 +215,9 @@ concurrency + + concurrency + concurrency diff --git a/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp index decacced..25680a14 100644 --- a/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp +++ b/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp @@ -19,6 +19,8 @@ #include +#ifdef USE_BOOST_THREAD + #include #include @@ -178,3 +180,5 @@ void BoostThreadFactory::setDetached(bool value) { impl_->setDetached(value); } Thread::id_t BoostThreadFactory::getCurrentThreadId() const { return impl_->getCurrentThreadId(); } }}} // apache::thrift::concurrency + +#endif // USE_BOOST_THREAD diff --git a/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp b/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp index 3239bd98..1fdefd5e 100644 --- a/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp +++ b/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp @@ -19,6 +19,8 @@ #include +#ifdef USE_STD_THREAD + #include #include @@ -169,3 +171,5 @@ void StdThreadFactory::setDetached(bool value) { impl_->setDetached(value); } Thread::id_t StdThreadFactory::getCurrentThreadId() const { return impl_->getCurrentThreadId(); } }}} // apache::thrift::concurrency + +#endif // USE_STD_THREAD -- 2.17.1