]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/thread/test/sync/mutual_exclusion/locks/lock_guard/default_pass.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / thread / test / sync / mutual_exclusion / locks / lock_guard / default_pass.cpp
index 68cb88e02736ea3133d72082f6610b6f0d2235d8..04faabe9e23621f4a7c4698bc8e68daa0f9b72f8 100644 (file)
@@ -33,6 +33,12 @@ typedef boost::chrono::nanoseconds ns;
 
 boost::mutex m;
 
+#ifdef BOOST_THREAD_PLATFORM_WIN32
+const ms max_diff(250);
+#else
+const ms max_diff(75);
+#endif
+
 void f()
 {
 #ifdef BOOST_THREAD_USES_CHRONO
@@ -43,8 +49,7 @@ void f()
     t1 = Clock::now();
   }
   ns d = t1 - t0 - ms(250);
-  // This test is spurious as it depends on the time the thread system switches the threads
-  BOOST_TEST(d < ns(2500000)+ms(1000)); // within 2.5ms
+  BOOST_TEST(d < max_diff);
 #else
   //time_point t0 = Clock::now();
   //time_point t1;
@@ -53,8 +58,7 @@ void f()
     //t1 = Clock::now();
   }
   //ns d = t1 - t0 - ms(250);
-  // This test is spurious as it depends on the time the thread system switches the threads
-  //BOOST_TEST(d < ns(2500000)+ms(1000)); // within 2.5ms
+  //BOOST_TEST(d < max_diff);
 #endif
 }