From f5353419acd2558c0121e0e26592b08192f975c3 Mon Sep 17 00:00:00 2001 From: pca006132 Date: Thu, 16 Sep 2021 21:36:42 +0800 Subject: [PATCH] codegen: minimized lock holding time The previous way of holding the lock would prohibit multithread code generation for llvm --- nac3core/src/codegen/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nac3core/src/codegen/mod.rs b/nac3core/src/codegen/mod.rs index f690c6bf0..1c3e4e16d 100644 --- a/nac3core/src/codegen/mod.rs +++ b/nac3core/src/codegen/mod.rs @@ -175,9 +175,9 @@ impl WorkerRegistry { } // do whatever... - let mut lock = self.task_count.lock(); module.verify().unwrap(); f.run(&module); + let mut lock = self.task_count.lock(); *lock += 1; self.wait_condvar.notify_all(); }