summaryrefslogtreecommitdiff
path: root/boost/fiber/condition_variable.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/fiber/condition_variable.hpp')
-rw-r--r--boost/fiber/condition_variable.hpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/boost/fiber/condition_variable.hpp b/boost/fiber/condition_variable.hpp
index cd0e7cb022..2cd3ecc719 100644
--- a/boost/fiber/condition_variable.hpp
+++ b/boost/fiber/condition_variable.hpp
@@ -70,6 +70,7 @@ public:
detail::spinlock_lock lk{ wait_queue_splk_ };
BOOST_ASSERT( ! active_ctx->wait_is_linked() );
active_ctx->wait_link( wait_queue_);
+ active_ctx->twstatus.store( static_cast< std::intptr_t >( 0), std::memory_order_release);
// unlock external lt
lt.unlock();
// suspend this fiber
@@ -101,6 +102,8 @@ public:
detail::spinlock_lock lk{ wait_queue_splk_ };
BOOST_ASSERT( ! active_ctx->wait_is_linked() );
active_ctx->wait_link( wait_queue_);
+ intrusive_ptr_add_ref( active_ctx);
+ active_ctx->twstatus.store( reinterpret_cast< std::intptr_t >( this), std::memory_order_release);
// unlock external lt
lt.unlock();
// suspend this fiber