From 3d59a477201d4d4f34b4332fda699c21387cf726 Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 8 Dec 2016 14:51:46 -0800 Subject: Added a message to ease the detection of platforms on which thread cancellation isn't supported. --- unsupported/test/cxx11_non_blocking_thread_pool.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'unsupported/test/cxx11_non_blocking_thread_pool.cpp') 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); } ); -- cgit v1.2.3