From 8ca458188d524edfe5af411f37392fabfeaaaafd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Fri, 19 Aug 2022 09:30:56 +0200 Subject: [PATCH] also those dispatcher tricks wont help the test, it still sporadically fails --- common/src/slowjob.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/common/src/slowjob.rs b/common/src/slowjob.rs index a7cb2d88dc..9af7b348d9 100644 --- a/common/src/slowjob.rs +++ b/common/src/slowjob.rs @@ -155,10 +155,14 @@ impl InternalSlowJobPool { let dispatch_receiver = Mutex::new(dispatch_receiver); let threadpool2 = Arc::clone(&threadpool); threadpool.spawn(move || { - let dispatch_receiver = dispatch_receiver.lock().unwrap(); - for task in dispatch_receiver.iter() { - threadpool2.spawn(task) - } + threadpool2.in_place_scope(|s| { + s.spawn(|s| { + let dispatch_receiver = dispatch_receiver.lock().unwrap(); + for task in dispatch_receiver.iter() { + s.spawn(|_| (task)()); + } + }); + }); }); }