mirror of
https://github.com/boostorg/fiber.git
synced 2026-02-16 13:22:17 +00:00
remove std::mutex associated with yield-queue
This commit is contained in:
@@ -89,7 +89,6 @@ private:
|
||||
sleep_queue_t sleep_queue_;
|
||||
bool shutdown_;
|
||||
detail::spinlock remote_ready_splk_;
|
||||
std::mutex mtx_;
|
||||
|
||||
void resume_( context *, context *);
|
||||
|
||||
|
||||
@@ -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_() );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user