From 4a63d4992ca9eb48d0abcffb6e257c155e224972 Mon Sep 17 00:00:00 2001 From: "Vicente J. Botet Escriba" Date: Thu, 26 Sep 2013 06:54:33 +0000 Subject: [PATCH] Thread: provide physical concurrency conditional until it no regression is introduced. [SVN r85926] --- include/boost/thread/detail/thread.hpp | 2 ++ src/pthread/thread.cpp | 4 ++++ src/win32/thread.cpp | 2 ++ test/Jamfile.v2 | 2 +- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/boost/thread/detail/thread.hpp b/include/boost/thread/detail/thread.hpp index 019d0d73..2f6c1581 100644 --- a/include/boost/thread/detail/thread.hpp +++ b/include/boost/thread/detail/thread.hpp @@ -546,7 +546,9 @@ namespace boost void detach(); static unsigned hardware_concurrency() BOOST_NOEXCEPT; +#ifdef BOOST_THREAD_PROVIDES_PHYSICAL_CONCURRENCY static unsigned physical_concurrency() BOOST_NOEXCEPT; +#endif #define BOOST_THREAD_DEFINES_THREAD_NATIVE_HANDLE typedef detail::thread_data_base::native_handle_type native_handle_type; diff --git a/src/pthread/thread.cpp b/src/pthread/thread.cpp index 39d476a4..e91473c2 100644 --- a/src/pthread/thread.cpp +++ b/src/pthread/thread.cpp @@ -27,6 +27,7 @@ #include #endif +#ifdef BOOST_THREAD_PROVIDES_PHYSICAL_CONCURRENCY #include #include #include @@ -35,6 +36,7 @@ #include #include #include +#endif #include "./timeconv.inl" @@ -552,6 +554,7 @@ namespace boost #endif } +#ifdef BOOST_THREAD_PROVIDES_PHYSICAL_CONCURRENCY unsigned thread::physical_concurrency() BOOST_NOEXCEPT { #ifdef __linux__ @@ -601,6 +604,7 @@ namespace boost return hardware_concurrency(); #endif } +#endif #if defined BOOST_THREAD_PROVIDES_INTERRUPTIONS void thread::interrupt() diff --git a/src/win32/thread.cpp b/src/win32/thread.cpp index 640664ef..f1774031 100644 --- a/src/win32/thread.cpp +++ b/src/win32/thread.cpp @@ -417,6 +417,7 @@ namespace boost return info.dwNumberOfProcessors; } +#ifdef BOOST_THREAD_PROVIDES_PHYSICAL_CONCURRENCY unsigned thread::physical_concurrency() BOOST_NOEXCEPT { unsigned cores = 0; @@ -438,6 +439,7 @@ namespace boost } return cores; } +#endif thread::native_handle_type thread::native_handle() { diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index 9c0f93f7..fc9d9b97 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -209,7 +209,7 @@ rule thread-compile ( sources : reqs * : name ) [ thread-test test_thread.cpp ] [ thread-test test_thread_id.cpp ] [ thread-test test_hardware_concurrency.cpp ] - [ thread-test test_physical_concurrency.cpp ] + #[ thread-test test_physical_concurrency.cpp ] [ thread-test test_thread_move.cpp ] [ thread-test test_thread_return_local.cpp ] [ thread-test test_thread_move_return.cpp ]