aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/test/cxx11_non_blocking_thread_pool.cpp
diff options
context:
space:
mode:
authorGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-12-08 14:51:46 -0800
committerGravatar Benoit Steiner <benoit.steiner.goog@gmail.com>2016-12-08 14:51:46 -0800
commit3d59a477201d4d4f34b4332fda699c21387cf726 (patch)
treef4cfb525481afdffbcce3c0b8d2974befbbd7193 /unsupported/test/cxx11_non_blocking_thread_pool.cpp
parent28ee8f42b269c5da474c550dc8d35fe41c085429 (diff)
Added a message to ease the detection of platforms on which thread cancellation isn't supported.
Diffstat (limited to 'unsupported/test/cxx11_non_blocking_thread_pool.cpp')
-rw-r--r--unsupported/test/cxx11_non_blocking_thread_pool.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/unsupported/test/cxx11_non_blocking_thread_pool.cpp b/unsupported/test/cxx11_non_blocking_thread_pool.cpp
index 0fc5a257a..fe30551ce 100644
--- a/unsupported/test/cxx11_non_blocking_thread_pool.cpp
+++ b/unsupported/test/cxx11_non_blocking_thread_pool.cpp
@@ -107,10 +107,14 @@ static void test_cancel()
NonBlockingThreadPool tp(4);
#ifdef EIGEN_SUPPORTS_THREAD_CANCELLATION
+ std::cout << "Thread cancellation is supported on this platform" << std::endl;
+
// Put 2 threads to sleep for much longer than the default test timeout.
tp.Schedule([]() { sleep(3600); } );
tp.Schedule([]() { sleep(3600 * 24); } );
#else
+ std::cout << "Thread cancellation is a no-op on this platform" << std::endl;
+
// Make 2 threads sleep for a short period of time
tp.Schedule([]() { sleep(1); } );
tp.Schedule([]() { sleep(2); } );