Fixed race condition on startup

This commit is contained in:
Justin Ethier 2015-12-08 23:13:22 -05:00
parent 9199bf512a
commit e5bf6e0e4e
2 changed files with 2 additions and 2 deletions

View file

@ -28,7 +28,6 @@ static void Cyc_heap_init(long heap_size)
printf("main: Allocating and initializing heap...\n");
#endif
gc_init_heap(heap_size);
gc_initialize();
gc_start_collector();
}

View file

@ -81,13 +81,14 @@
mclosure0(entry_pt,&c_entry_pt); // First function to execute
_cyc_argc = argc;
_cyc_argv = argv;
Cyc_heap_init(heap_size);
gc_initialize();
thd = malloc(sizeof(gc_thread_data));
gc_thread_data_init(thd, 0, (char *) &stack_size, stack_size);
thd->gc_cont = &entry_pt;
thd->gc_args[0] = &clos_halt;
thd->gc_num_args = 1;
gc_add_mutator(thd);
Cyc_heap_init(heap_size);
Cyc_start_thread(thd);
return 0;}")