]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/interprocess/sync/spin/mutex.hpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / boost / boost / interprocess / sync / spin / mutex.hpp
index f633b6a60fe6a55ba98f9e1d9e712cf270ed656a..ce9f87fe79bda7d408a582395e6c68851ac098e2 100644 (file)
@@ -21,7 +21,6 @@
 
 #include <boost/interprocess/detail/config_begin.hpp>
 #include <boost/interprocess/detail/workaround.hpp>
-#include <boost/interprocess/detail/posix_time_types_wrk.hpp>
 #include <boost/assert.hpp>
 #include <boost/interprocess/detail/atomic.hpp>
 #include <boost/cstdint.hpp>
@@ -43,7 +42,15 @@ class spin_mutex
 
    void lock();
    bool try_lock();
-   bool timed_lock(const boost::posix_time::ptime &abs_time);
+   template<class TimePoint>
+   bool timed_lock(const TimePoint &abs_time);
+
+   template<class TimePoint> bool try_lock_until(const TimePoint &abs_time)
+   {  return this->timed_lock(abs_time);  }
+
+   template<class Duration>  bool try_lock_for(const Duration &dur)
+   {  return this->timed_lock(duration_to_ustime(dur)); }
+
    void unlock();
    void take_ownership(){}
    private:
@@ -60,7 +67,8 @@ class spin_mutex
          ipcdetail::try_based_lock(m_sp);
       }
 
-      bool timed_lock(const boost::posix_time::ptime &abs_time)
+      template<class TimePoint>
+      bool timed_lock(const TimePoint &abs_time)
       {  return m_sp.timed_lock(abs_time);   }
 
       spin_mutex &m_sp;
@@ -92,7 +100,8 @@ inline bool spin_mutex::try_lock(void)
    return m_s == 1 && prev_s == 0;
 }
 
-inline bool spin_mutex::timed_lock(const boost::posix_time::ptime &abs_time)
+template<class TimePoint>
+inline bool spin_mutex::timed_lock(const TimePoint &abs_time)
 {  return ipcdetail::try_based_timed_lock(*this, abs_time); }
 
 inline void spin_mutex::unlock(void)