From 88534ba623421c956d8ffcda2d27f41d704d15ef Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 3 Jul 2018 07:37:12 +0200 Subject: update eigen --- eigen/unsupported/test/cxx11_tensor_notification.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'eigen/unsupported/test/cxx11_tensor_notification.cpp') diff --git a/eigen/unsupported/test/cxx11_tensor_notification.cpp b/eigen/unsupported/test/cxx11_tensor_notification.cpp index 183ef02..c946007 100644 --- a/eigen/unsupported/test/cxx11_tensor_notification.cpp +++ b/eigen/unsupported/test/cxx11_tensor_notification.cpp @@ -13,6 +13,15 @@ #include "main.h" #include +#if EIGEN_OS_WIN || EIGEN_OS_WIN64 +#include +void sleep(int seconds) { + Sleep(seconds*1000); +} +#else +#include +#endif + namespace { @@ -31,7 +40,7 @@ static void test_notification_single() Eigen::Notification n; std::function func = std::bind(&WaitAndAdd, &n, &counter); thread_pool.Schedule(func); - EIGEN_SLEEP(1000); + sleep(1); // The thread should be waiting for the notification. VERIFY_IS_EQUAL(counter, 0); @@ -39,7 +48,7 @@ static void test_notification_single() // Unblock the thread n.Notify(); - EIGEN_SLEEP(1000); + sleep(1); // Verify the counter has been incremented VERIFY_IS_EQUAL(counter, 1); @@ -58,10 +67,10 @@ static void test_notification_multiple() thread_pool.Schedule(func); thread_pool.Schedule(func); thread_pool.Schedule(func); - EIGEN_SLEEP(1000); + sleep(1); VERIFY_IS_EQUAL(counter, 0); n.Notify(); - EIGEN_SLEEP(1000); + sleep(1); VERIFY_IS_EQUAL(counter, 4); } -- cgit v1.2.3