]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/thread/test/sync/mutual_exclusion/null_mutex/lock_pass.cpp
import new upstream nautilus stable release 14.2.8
[ceph.git] / ceph / src / boost / libs / thread / test / sync / mutual_exclusion / null_mutex / lock_pass.cpp
index 7aabed23608b52aca18b7ee97bbb58fc72123259..3c91e25f6196f8f65a061b9f967a13d482dc0461 100644 (file)
 #include <boost/thread/null_mutex.hpp>
 #include <boost/thread/thread.hpp>
 #include <boost/detail/lightweight_test.hpp>
-
-
+#include "../../../timming.hpp"
 
 boost::null_mutex m;
 
 #if defined BOOST_THREAD_USES_CHRONO
-typedef boost::chrono::system_clock Clock;
+typedef boost::chrono::high_resolution_clock Clock;
 typedef Clock::time_point time_point;
 typedef Clock::duration duration;
 typedef boost::chrono::milliseconds ms;
@@ -35,11 +34,7 @@ typedef boost::chrono::nanoseconds ns;
 #else
 #endif
 
-#ifdef BOOST_THREAD_PLATFORM_WIN32
-const ms max_diff(250);
-#else
-const ms max_diff(50);
-#endif
+const ms max_diff(BOOST_THREAD_TEST_TIME_MS);
 
 void f()
 {
@@ -51,7 +46,7 @@ void f()
   m.unlock();
   m.unlock();
   ns d = t1 - t0 ;
-  BOOST_TEST(d < max_diff);
+  BOOST_THREAD_TEST_IT(d, ns(max_diff));
 #else
   //time_point t0 = Clock::now();
   m.lock();