From e63a5bdf899186865c2b798fd1a9fa776668ee02 Mon Sep 17 00:00:00 2001 From: Wesley Shillingford Date: Fri, 12 Apr 2019 14:57:59 +0100 Subject: [PATCH] Fix TSAN warning with work.eco_pow (#1893) --- nano/core_test/work_pool.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nano/core_test/work_pool.cpp b/nano/core_test/work_pool.cpp index 05e16066..5559a5e5 100644 --- a/nano/core_test/work_pool.cpp +++ b/nano/core_test/work_pool.cpp @@ -180,10 +180,10 @@ TEST (work, eco_pow) std::thread thread1 (work_func, std::ref (promise1), std::chrono::nanoseconds (0)); std::thread thread2 (work_func, std::ref (promise2), std::chrono::milliseconds (10)); + thread1.join (); + thread2.join (); + // Confirm that the eco pow rate limiter is working. // It's possible under some unlucky circumstances that this fails to the random nature of valid work generation. ASSERT_LT (future1.get (), future2.get ()); - - thread1.join (); - thread2.join (); }