]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/detail/std_event.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / asio / detail / std_event.hpp
index 914f9d93d0c40fa29592ff2539531eadd317e259..6476865724728dec1ee6615998d3583359f31ca5 100644 (file)
@@ -74,6 +74,18 @@ public:
       cond_.notify_one();
   }
 
+  // Unlock the mutex and signal one waiter who may destroy us.
+  template <typename Lock>
+  void unlock_and_signal_one_for_destruction(Lock& lock)
+  {
+    BOOST_ASIO_ASSERT(lock.locked());
+    state_ |= 1;
+    bool have_waiters = (state_ > 1);
+    if (have_waiters)
+      cond_.notify_one();
+    lock.unlock();
+  }
+
   // If there's a waiter, unlock the mutex and signal it.
   template <typename Lock>
   bool maybe_unlock_and_signal_one(Lock& lock)