Skip to content

Commit 570defa

Browse files
davidlattimoreNthTensor
authored andcommitted
fix: Avoid dropping of tasks that don't fit in local queue
1 parent e4a9bc2 commit 570defa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/scope.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ impl<'scope, 'env> Scope<'scope, 'env> {
135135
let job_ref = unsafe { job.into_job_ref() };
136136

137137
// Send the job to a queue to be executed.
138-
worker.queue.push_back(job_ref);
138+
worker.enqueue(job_ref);
139139
}
140140

141141
/// Spawns a future onto the scope. This future will be asynchronously
@@ -198,7 +198,7 @@ impl<'scope, 'env> Scope<'scope, 'env> {
198198
// same thread instead of jumping around randomly. This is also
199199
// faster than injecting into the global queue.
200200
thread_pool.with_worker(|worker| {
201-
worker.queue.push_back(job_ref);
201+
worker.enqueue(job_ref);
202202
});
203203
};
204204

0 commit comments

Comments
 (0)