275-fix-random-sigsegv #302

Merged
sb10q merged 9 commits from 275-fix-random-sigsegv into master 2022-07-04 18:06:36 +08:00
1 changed files with 1 additions and 6 deletions
Showing only changes of commit 8fb413a7bb - Show all commits

View File

@ -159,7 +159,6 @@ impl WorkerRegistry {
let handle = thread::spawn(move || { let handle = thread::spawn(move || {
registry.worker_thread(generator.as_mut(), f); registry.worker_thread(generator.as_mut(), f);
}); });
let handle = thread::spawn(move || { let handle = thread::spawn(move || {
if let Err(e) = handle.join() { if let Err(e) = handle.join() {
if let Some(e) = e.downcast_ref::<&'static str>() { if let Some(e) = e.downcast_ref::<&'static str>() {
@ -171,7 +170,6 @@ impl WorkerRegistry {
registry2.wait_condvar.notify_all(); registry2.wait_condvar.notify_all();
} }
}); });
handles.push(handle); handles.push(handle);
} }
(registry, handles) (registry, handles)
@ -212,10 +210,7 @@ impl WorkerRegistry {
self.sender.send(Some(task)).unwrap(); self.sender.send(Some(task)).unwrap();
} }
fn worker_thread<G: CodeGenerator>( fn worker_thread<G: CodeGenerator>(&self, generator: &mut G, f: Arc<WithCall>) {
&self, generator:
&mut G, f: Arc<WithCall>
) {
let context = Context::create(); let context = Context::create();
let mut builder = context.create_builder(); let mut builder = context.create_builder();
let mut module = context.create_module(generator.get_name()); let mut module = context.create_module(generator.get_name());