Permalink
Browse files

resume_with() requires tor return a continuation

  • Loading branch information...
olk committed Aug 10, 2017
1 parent 556c9ec commit 63f1041f0e484e64dec437a0fa780ea2463abda2
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/context.cpp
View
@@ -145,6 +145,7 @@ context::resume() noexcept {
// pass pointer to the context that resumes `this`
c_.resume_with([prev](boost::context::continuation && c){
prev->c_ = std::move( c);
return boost::context::continuation{};
});
}
@@ -158,6 +159,7 @@ context::resume( detail::spinlock_lock & lk) noexcept {
c_.resume_with([prev,&lk](boost::context::continuation && c){
prev->c_ = std::move( c);
lk.unlock();
return boost::context::continuation{};
});
}
@@ -171,6 +173,7 @@ context::resume( context * ready_ctx) noexcept {
c_.resume_with([prev,ready_ctx](boost::context::continuation && c){
prev->c_ = std::move( c);
context::active()->schedule( ready_ctx);
return boost::context::continuation{};
});
}
@@ -218,6 +221,7 @@ context::suspend_with_cc() noexcept {
// pass pointer to the context that resumes `this`
return c_.resume_with([prev](boost::context::continuation && c){
prev->c_ = std::move( c);
return boost::context::continuation{};
});
}

0 comments on commit 63f1041

Please sign in to comment.