From 45af3585db0ae77defb53f6c827110b66f4c850f Mon Sep 17 00:00:00 2001 From: oliver Kowalke Date: Fri, 8 Apr 2016 14:02:32 +0200 Subject: [PATCH] migrate context: scheduler must be different --- src/context.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/context.cpp b/src/context.cpp index b33c0e70..bd9ff421 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -533,8 +533,10 @@ void context::migrate( context * ctx) noexcept { BOOST_ASSERT( nullptr != ctx); BOOST_ASSERT( context::active() != ctx); - ctx->scheduler_->detach_worker_context( ctx); - scheduler_->attach_worker_context( ctx); + if ( scheduler_ != ctx->scheduler_) { + ctx->scheduler_->detach_worker_context( ctx); + scheduler_->attach_worker_context( ctx); + } } }}