2
0
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:
Oliver Kowalke
2015-09-11 18:42:16 +02:00
parent e44a41b71e
commit abd1ff524c
18 changed files with 198 additions and 199 deletions

View File

@@ -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;
}
}
}