From 01dda0048fd1053dc3ad78a95df2db1935003619 Mon Sep 17 00:00:00 2001 From: Oliver Kowalke Date: Sun, 11 Oct 2015 08:42:48 +0200 Subject: [PATCH] remove std::mutex associated with yield-queue --- include/boost/fiber/scheduler.hpp | 1 - src/scheduler.cpp | 3 --- 2 files changed, 4 deletions(-) diff --git a/include/boost/fiber/scheduler.hpp b/include/boost/fiber/scheduler.hpp index 0d2bfd17..c98c80ac 100644 --- a/include/boost/fiber/scheduler.hpp +++ b/include/boost/fiber/scheduler.hpp @@ -89,7 +89,6 @@ private: sleep_queue_t sleep_queue_; bool shutdown_; detail::spinlock remote_ready_splk_; - std::mutex mtx_; void resume_( context *, context *); diff --git a/src/scheduler.cpp b/src/scheduler.cpp index 694535ee..684a191e 100644 --- a/src/scheduler.cpp +++ b/src/scheduler.cpp @@ -106,7 +106,6 @@ scheduler::remote_ready2ready_() { void scheduler::yield2ready_() { - std::unique_lock< std::mutex > lk( mtx_); // get context from yield-queue while ( ! yield_queue_.empty() ) { context * ctx = & yield_queue_.front(); @@ -360,9 +359,7 @@ scheduler::yield( context * active_ctx) noexcept { // in work-sharing context (multiple threads read // from one ready-queue) the context must be // already suspended until another thread resumes it - std::unique_lock< std::mutex > lk( mtx_); active_ctx->yield_link( yield_queue_); - lk.unlock(); // resume another fiber resume_( active_ctx, get_next_() ); }