mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-20 02:32:19 +00:00
link/unlink of context protected by spinlock
This commit is contained in:
@@ -69,7 +69,7 @@ recursive_timed_mutex::lock() {
|
||||
// store this fiber in order to be notified later
|
||||
detail::spinlock_lock lk( wait_queue_splk_);
|
||||
BOOST_ASSERT( ! ctx->wait_is_linked() );
|
||||
wait_queue_.push_back( * ctx);
|
||||
ctx->wait_link( wait_queue_);
|
||||
lk.unlock();
|
||||
// suspend this fiber
|
||||
ctx->suspend();
|
||||
@@ -109,7 +109,7 @@ recursive_timed_mutex::try_lock_until_( std::chrono::steady_clock::time_point co
|
||||
// store this fiber in order to be notified later
|
||||
detail::spinlock_lock lk( wait_queue_splk_);
|
||||
BOOST_ASSERT( ! ctx->wait_is_linked() );
|
||||
wait_queue_.push_back( * ctx);
|
||||
ctx->wait_link( wait_queue_);
|
||||
lk.unlock();
|
||||
// suspend this fiber until notified or timed-out
|
||||
if ( ! ctx->wait_until( timeout_time) ) {
|
||||
|
||||
Reference in New Issue
Block a user