From 5109d7e16d6c862d82557f6d5dfdc230f42d08fb Mon Sep 17 00:00:00 2001 From: David Lattimore Date: Sat, 29 Nov 2025 15:15:54 +1100 Subject: [PATCH] fix: Avoid dropping of tasks that don't fit in local queue --- src/scope.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scope.rs b/src/scope.rs index eaa6b5d..d1d97ce 100644 --- a/src/scope.rs +++ b/src/scope.rs @@ -135,7 +135,7 @@ impl<'scope, 'env> Scope<'scope, 'env> { let job_ref = unsafe { job.into_job_ref() }; // Send the job to a queue to be executed. - worker.queue.push_back(job_ref); + worker.enqueue(job_ref); } /// Spawns a future onto the scope. This future will be asynchronously @@ -198,7 +198,7 @@ impl<'scope, 'env> Scope<'scope, 'env> { // same thread instead of jumping around randomly. This is also // faster than injecting into the global queue. thread_pool.with_worker(|worker| { - worker.queue.push_back(job_ref); + worker.enqueue(job_ref); }); };