]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/thread/test/sync/futures/shared_future/wait_for_pass.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / thread / test / sync / futures / shared_future / wait_for_pass.cpp
index edaf56d9c3036ba82733e73cee6695694aa06667..e9d8ac684540c9e096365b450f940f5fc10948a2 100644 (file)
@@ -29,6 +29,7 @@
 #include <boost/thread/thread.hpp>
 #include <boost/chrono/chrono_io.hpp>
 #include <boost/detail/lightweight_test.hpp>
+#include "../../../timming.hpp"
 
 #if defined BOOST_THREAD_USES_CHRONO
 
@@ -37,6 +38,7 @@
 #endif
 
 typedef boost::chrono::milliseconds ms;
+typedef boost::chrono::nanoseconds ns;
 
 namespace boost
 {
@@ -85,11 +87,7 @@ void func5(boost::promise<void> p)
   p.set_value();
 }
 
-#ifdef BOOST_THREAD_PLATFORM_WIN32
-const ms max_diff(250);
-#else
-const ms max_diff(75);
-#endif
+const ms max_diff(BOOST_THREAD_TEST_TIME_MS);
 
 int main()
 {
@@ -116,7 +114,8 @@ int main()
       f.wait();
       Clock::time_point t1 = Clock::now();
       BOOST_TEST(f.valid());
-      BOOST_TEST(t1 - t0 < max_diff);
+      ns d = t1 - t0;
+      BOOST_THREAD_TEST_IT(d, ns(max_diff));
     }
     {
       typedef int& T;
@@ -138,7 +137,8 @@ int main()
       f.wait();
       Clock::time_point t1 = Clock::now();
       BOOST_TEST(f.valid());
-      BOOST_TEST(t1 - t0 < max_diff);
+      ns d = t1 - t0;
+      BOOST_THREAD_TEST_IT(d, ns(max_diff));
     }
     {
       typedef void T;
@@ -160,7 +160,8 @@ int main()
       f.wait();
       Clock::time_point t1 = Clock::now();
       BOOST_TEST(f.valid());
-      BOOST_TEST(t1 - t0 < max_diff);
+      ns d = t1 - t0;
+      BOOST_THREAD_TEST_IT(d, ns(max_diff));
     }
   }
   BOOST_THREAD_LOG << BOOST_THREAD_END_LOG;