]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/thread/test/sync/mutual_exclusion/mutex/lock_pass.cpp
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / boost / libs / thread / test / sync / mutual_exclusion / mutex / lock_pass.cpp
index 6839a77099e3f18e8c99bb1c348b92eb6ac126e7..d1356bf792b8e5f628093944eaeb7e78a3a58de9 100644 (file)
@@ -34,6 +34,12 @@ typedef boost::chrono::nanoseconds ns;
 #else
 #endif
 
+#ifdef BOOST_THREAD_PLATFORM_WIN32
+const ms max_diff(250);
+#else
+const ms max_diff(75);
+#endif
+
 void f()
 {
 #if defined BOOST_THREAD_USES_CHRONO
@@ -42,16 +48,14 @@ void f()
   time_point t1 = Clock::now();
   m.unlock();
   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();
   m.lock();
   //time_point t1 = Clock::now();
   m.unlock();
   //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
 }