]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/boost/asio/detail/impl/select_reactor.ipp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / boost / asio / detail / impl / select_reactor.ipp
index 34d3d9f031951912ea51992b0502507254d7e80b..00b0fb579137e1a002ca6f4e2470ec64193db6d0 100644 (file)
@@ -2,7 +2,7 @@
 // detail/impl/select_reactor.ipp
 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 //
-// Copyright (c) 2003-2019 Christopher M. Kohlhoff (chris at kohlhoff dot com)
+// Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
 //
 // Distributed under the Boost Software License, Version 1.0. (See accompanying
 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -81,13 +81,14 @@ void select_reactor::shutdown()
   shutdown_ = true;
 #if defined(BOOST_ASIO_HAS_IOCP)
   stop_thread_ = true;
+  if (thread_)
+    interrupter_.interrupt();
 #endif // defined(BOOST_ASIO_HAS_IOCP)
   lock.unlock();
 
 #if defined(BOOST_ASIO_HAS_IOCP)
   if (thread_)
   {
-    interrupter_.interrupt();
     thread_->join();
     delete thread_;
     thread_ = 0;
@@ -240,7 +241,11 @@ void select_reactor::run(long usec, op_queue<operation>& ops)
   // Reset the interrupter.
   if (retval > 0 && fd_sets_[read_op].is_set(interrupter_.read_descriptor()))
   {
-    interrupter_.reset();
+    if (!interrupter_.reset())
+    {
+      lock.lock();
+      interrupter_.recreate();
+    }
     --retval;
   }