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

set active context to nullptr in ~scheduler()

This commit is contained in:
Oliver Kowalke
2015-09-30 19:58:04 +02:00
parent 275ae3b981
commit 20196fcd69
3 changed files with 9 additions and 0 deletions

View File

@@ -250,6 +250,8 @@ public:
static void active( context * active) noexcept;
static void reset_active() noexcept;
// main fiber context
context( main_context_t);

View File

@@ -44,6 +44,11 @@ context::active( context * active) noexcept {
active_ = active;
}
void
context::reset_active() noexcept {
active_ = nullptr;
}
void
context::set_terminated_() noexcept {
// protect for concurrent access

View File

@@ -153,6 +153,8 @@ scheduler::~scheduler() noexcept {
BOOST_ASSERT( ! sched_algo_->has_ready_fibers() );
BOOST_ASSERT( remote_ready_queue_.empty() );
BOOST_ASSERT( sleep_queue_.empty() );
// set active context to nullptr
context::reset_active();
// deallocate dispatcher-context
dispatcher_ctx_.reset();
// set main-context to nullptr