diff --git a/include/boost/fiber/scheduler.hpp b/include/boost/fiber/scheduler.hpp index 29041f30..f2c331af 100644 --- a/include/boost/fiber/scheduler.hpp +++ b/include/boost/fiber/scheduler.hpp @@ -120,9 +120,8 @@ public: std::chrono::steady_clock::time_point const&, detail::spinlock_lock &) noexcept; - void suspend( context *) noexcept; - void suspend( context *, - detail::spinlock_lock &) noexcept; + void suspend() noexcept; + void suspend( detail::spinlock_lock &) noexcept; bool has_ready_fibers() const noexcept; diff --git a/src/context.cpp b/src/context.cpp index dac4dafd..d0a37c61 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -288,12 +288,12 @@ context::resume( context * ready_ctx) noexcept { void context::suspend() noexcept { - scheduler_->suspend( this); + scheduler_->suspend(); } void context::suspend( detail::spinlock_lock & lk) noexcept { - scheduler_->suspend( this, lk); + scheduler_->suspend( lk); } void @@ -310,7 +310,7 @@ context::join() { active_ctx->wait_link( wait_queue_); lk.unlock(); // suspend active context - scheduler_->suspend( active_ctx); + scheduler_->suspend(); // remove from wait-queue active_ctx->wait_unlink(); // active context resumed diff --git a/src/scheduler.cpp b/src/scheduler.cpp index 89e1037f..94b32a18 100644 --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -332,18 +332,13 @@ scheduler::wait_until( context * active_ctx, } void -scheduler::suspend( context * active_ctx) noexcept { - BOOST_ASSERT( nullptr != active_ctx); - //BOOST_ASSERT( main_ctx_ == active_ctx || dispatcher_ctx_.get() == active_ctx || active_ctx->worker_is_linked() ); +scheduler::suspend() noexcept { // resume another context get_next_()->resume(); } void -scheduler::suspend( context * active_ctx, - detail::spinlock_lock & lk) noexcept { - BOOST_ASSERT( nullptr != active_ctx); - //BOOST_ASSERT( main_ctx_ == active_ctx || dispatcher_ctx_.get() == active_ctx || active_ctx->worker_is_linked() ); +scheduler::suspend( detail::spinlock_lock & lk) noexcept { // resume another context get_next_()->resume( lk); }