2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-18 01:52:24 +00:00

remote ready-queue uses differrent hook than local ready-queue

This commit is contained in:
Oliver Kowalke
2015-09-20 22:06:59 +02:00
parent 7b1e7839b4
commit eec3d34fb0
4 changed files with 84 additions and 44 deletions

View File

@@ -57,6 +57,7 @@ context::context( main_context_t) :
scheduler_( nullptr),
ctx_( boost::context::execution_context::current() ),
ready_hook_(),
remote_ready_hook_(),
terminated_hook_(),
wait_hook_(),
tp_( (std::chrono::steady_clock::time_point::max)() ),
@@ -78,6 +79,7 @@ context::context( dispatcher_context_t, boost::context::preallocated const& pall
BOOST_ASSERT_MSG( false, "disatcher fiber already terminated");
}),
ready_hook_(),
remote_ready_hook_(),
terminated_hook_(),
wait_hook_(),
tp_( (std::chrono::steady_clock::time_point::max)() ),
@@ -86,9 +88,11 @@ context::context( dispatcher_context_t, boost::context::preallocated const& pall
}
context::~context() {
BOOST_ASSERT( ! wait_is_linked() );
BOOST_ASSERT( wait_queue_.empty() );
BOOST_ASSERT( ! ready_is_linked() );
BOOST_ASSERT( ! remote_ready_is_linked() );
BOOST_ASSERT( ! sleep_is_linked() );
BOOST_ASSERT( ! wait_is_linked() );
}
void
@@ -187,21 +191,26 @@ context::set_ready( context * ctx) noexcept {
}
}
bool
context::wait_is_linked() {
return wait_hook_.is_linked();
}
bool
context::ready_is_linked() {
return ready_hook_.is_linked();
}
bool
context::remote_ready_is_linked() {
return remote_ready_hook_.is_linked();
}
bool
context::sleep_is_linked() {
return sleep_hook_.is_linked();
}
bool
context::wait_is_linked() {
return wait_hook_.is_linked();
}
void
context::sleep_unlink() {
sleep_hook_.unlink();