codegen: minimized lock holding time

The previous way of holding the lock would prohibit multithread code
generation for llvm
escape-analysis
pca006132 2021-09-16 21:36:42 +08:00
parent 180392e2ab
commit f5353419ac
1 changed files with 1 additions and 1 deletions

View File

@ -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();
}