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

start dispatcher-context in dtor of scheduler

This commit is contained in:
oliver Kowalke
2016-04-20 09:58:34 +02:00
parent 57267ec957
commit 2fd3383dc6

View File

@@ -109,10 +109,10 @@ scheduler::~scheduler() {
// signal dispatcher-context termination
shutdown_ = true;
// resume pending fibers
context * ctx = get_next_();
if ( nullptr != ctx) {
ctx->resume();
}
// by resuming dispatcher-context
// (unlink it from ready-queuei before)
dispatcher_ctx_->ready_unlink();
dispatcher_ctx_->resume();
// no context' in worker-queue
std::unique_lock< detail::spinlock > lk( worker_splk_);
BOOST_ASSERT( worker_queue_.empty() );