mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-04-23 01:59:38 +08:00
Added a message to ease the detection of platforms on which thread cancellation isn't supported.
This commit is contained in:
parent
28ee8f42b2
commit
3d59a47720
@ -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); } );
|
||||
|
Loading…
x
Reference in New Issue
Block a user