]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/boost/libs/fiber/src/condition_variable.cpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / libs / fiber / src / condition_variable.cpp
index c391b8c50ad59b8e33553885738592d07e96158e..199a56112fe0088f33e5ea100174e4ab94502c00 100644 (file)
@@ -23,12 +23,13 @@ condition_variable_any::notify_one() noexcept {
     while ( ! wait_queue_.empty() ) {
         context * ctx = & wait_queue_.front();
         wait_queue_.pop_front();
-        std::intptr_t expected = reinterpret_cast< std::intptr_t >( this);
+        auto expected = reinterpret_cast< std::intptr_t >( this);
         if ( ctx->twstatus.compare_exchange_strong( expected, static_cast< std::intptr_t >( -1), std::memory_order_acq_rel) ) {
             // notify context
             active_ctx->schedule( ctx);
             break;
-        } else if ( static_cast< std::intptr_t >( 0) == expected) {
+        }
+        if ( static_cast< std::intptr_t >( 0) == expected) {
             // no timed-wait op.
             // notify context
             active_ctx->schedule( ctx);
@@ -46,7 +47,7 @@ condition_variable_any::notify_all() noexcept {
     while ( ! wait_queue_.empty() ) {
         context * ctx = & wait_queue_.front();
         wait_queue_.pop_front();
-        std::intptr_t expected = reinterpret_cast< std::intptr_t >( this);
+        auto expected = reinterpret_cast< std::intptr_t >( this);
         if ( ctx->twstatus.compare_exchange_strong( expected, static_cast< std::intptr_t >( -1), std::memory_order_acq_rel) ) {
             // notify context
             active_ctx->schedule( ctx);