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

migrate context: scheduler must be different

This commit is contained in:
oliver Kowalke
2016-04-08 14:02:32 +02:00
parent 918f450027
commit 45af3585db

View File

@@ -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);
}
}
}}