summaryrefslogtreecommitdiffhomepage
path: root/eigen/unsupported/test/cxx11_tensor_notification.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-07-03 07:37:12 +0200
committerStanislaw Halik <sthalik@misaki.pl>2018-07-03 08:13:09 +0200
commit88534ba623421c956d8ffcda2d27f41d704d15ef (patch)
treefccc55245aec3f7381cd525a1355568e10ea37f4 /eigen/unsupported/test/cxx11_tensor_notification.cpp
parent3ee09beb3f0458fbeb0b0e816f854b9d5b406e6b (diff)
update eigen
Diffstat (limited to 'eigen/unsupported/test/cxx11_tensor_notification.cpp')
-rw-r--r--eigen/unsupported/test/cxx11_tensor_notification.cpp17
1 files changed, 13 insertions, 4 deletions
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 <Eigen/CXX11/Tensor>
+#if EIGEN_OS_WIN || EIGEN_OS_WIN64
+#include <windows.h>
+void sleep(int seconds) {
+ Sleep(seconds*1000);
+}
+#else
+#include <unistd.h>
+#endif
+
namespace {
@@ -31,7 +40,7 @@ static void test_notification_single()
Eigen::Notification n;
std::function<void()> 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);
}