From 32ffce04fc3415ef10d2913fc90806077602e87d Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 21 Apr 2016 08:47:28 -0700 Subject: [PATCH] Use EIGEN_THREAD_YIELD instead of std::this_thread::yield to make the code more portable. --- unsupported/test/cxx11_eventcount.cpp | 2 +- unsupported/test/cxx11_runqueue.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/unsupported/test/cxx11_eventcount.cpp b/unsupported/test/cxx11_eventcount.cpp index 2f250338c..f16cc6f07 100644 --- a/unsupported/test/cxx11_eventcount.cpp +++ b/unsupported/test/cxx11_eventcount.cpp @@ -95,7 +95,7 @@ static void test_stress_eventcount() ec.Notify(false); continue; } - std::this_thread::yield(); + EIGEN_THREAD_YIELD(); j--; } })); diff --git a/unsupported/test/cxx11_runqueue.cpp b/unsupported/test/cxx11_runqueue.cpp index 4207824bf..6c99eb981 100644 --- a/unsupported/test/cxx11_runqueue.cpp +++ b/unsupported/test/cxx11_runqueue.cpp @@ -184,7 +184,7 @@ void test_stress_runqueue() sum += j; continue; } - std::this_thread::yield(); + EIGEN_THREAD_YIELD(); j--; } total += sum; @@ -194,7 +194,7 @@ void test_stress_runqueue() std::vector stolen; for (int j = 1; j < kEvents;) { if (q.PopBackHalf(&stolen) == 0) { - std::this_thread::yield(); + EIGEN_THREAD_YIELD(); continue; } while (stolen.size() && j < kEvents) { @@ -209,7 +209,7 @@ void test_stress_runqueue() int v = stolen.back(); stolen.pop_back(); VERIFY_IS_NOT_EQUAL(v, 0); - while ((v = q.PushBack(v)) != 0) std::this_thread::yield(); + while ((v = q.PushBack(v)) != 0) EIGEN_THREAD_YIELD(); } total -= sum; }));