mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-17 01:32:32 +00:00
fixes for signaling interruption and wait
This commit is contained in:
@@ -61,14 +61,22 @@ recursive_mutex::lock() {
|
||||
return;
|
||||
}
|
||||
|
||||
// store this fiber in order to be notified later
|
||||
BOOST_ASSERT( ! f->wait_is_linked() );
|
||||
f->set_waiting();
|
||||
wait_queue_.push_back( * f);
|
||||
lk.unlock();
|
||||
try {
|
||||
// store this fiber in order to be notified later
|
||||
BOOST_ASSERT( ! f->wait_is_linked() );
|
||||
f->set_waiting();
|
||||
wait_queue_.push_back( * f);
|
||||
lk.unlock();
|
||||
|
||||
// suspend this fiber
|
||||
f->do_schedule();
|
||||
// check if fiber was interrupted
|
||||
this_fiber::interruption_point();
|
||||
// suspend this fiber
|
||||
f->do_schedule();
|
||||
} catch (...) {
|
||||
detail::spinlock_lock lk( splk_);
|
||||
f->wait_unlink();
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user