2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-18 01:52:24 +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

@@ -76,6 +76,7 @@ context::join( context * f) {
if ( is_terminated() ) {
return false;
}
f->set_waiting();
wait_queue_.push_back( f);
return true;
}
@@ -143,14 +144,6 @@ context::set_properties( fiber_properties * props) {
properties_ = props;
}
bool
context::do_wait_until_( std::chrono::steady_clock::time_point const& time_point) {
BOOST_ASSERT( nullptr != scheduler_);
BOOST_ASSERT( this == active_);
return scheduler_->wait_until( this, time_point);
}
void
context::do_spawn( fiber const& f) {
BOOST_ASSERT( nullptr != scheduler_);
@@ -167,6 +160,14 @@ context::do_schedule() {
scheduler_->run( this);
}
bool
context::do_wait_until( std::chrono::steady_clock::time_point const& time_point) {
BOOST_ASSERT( nullptr != scheduler_);
BOOST_ASSERT( this == active_);
return scheduler_->wait_until( this, time_point);
}
void
context::do_yield() {
BOOST_ASSERT( nullptr != scheduler_);
@@ -198,7 +199,7 @@ context::do_signal( context * f) {
scheduler_->signal( f);
} else {
// scheduler in another thread
f->scheduler_->signal( f);
f->scheduler_->remote_signal( f);
}
}
@@ -218,14 +219,6 @@ context::do_set_sched_algo( std::unique_ptr< sched_algorithm > algo) {
scheduler_->set_sched_algo( std::move( algo) );
}
std::chrono::steady_clock::duration
context::do_wait_interval() noexcept {
BOOST_ASSERT( nullptr != scheduler_);
BOOST_ASSERT( this == active_);
return scheduler_->wait_interval();
}
}}
#ifdef BOOST_HAS_ABI_HEADERS