void scheme_places_start_child_signal_handler() { mz_proc_thread *signal_thread; mzrt_mutex_create(&child_status_lock); mzrt_mutex_create(&child_wait_lock); signal_thread = mz_proc_thread_create(mz_proc_thread_signal_worker, NULL); mz_proc_thread_detach(signal_thread); }
static void init_type_arrays() { intptr_t n; #ifdef MZ_USE_PLACES mzrt_mutex_create(&type_array_mutex); #endif REGISTER_SO(type_names); REGISTER_SO(scheme_type_readers); REGISTER_SO(scheme_type_writers); REGISTER_SO(scheme_type_equals); REGISTER_SO(scheme_type_hash1s); REGISTER_SO(scheme_type_hash2s); maxtype = _scheme_last_type_; allocmax = maxtype + 100; type_names = RAW_MALLOC_N(char *, allocmax); memset(type_names, 0, allocmax * sizeof(char *)); scheme_type_readers = RAW_MALLOC_N(Scheme_Type_Reader, allocmax); n = allocmax * sizeof(Scheme_Type_Reader); memset(scheme_type_readers, 0, n); #ifdef MEMORY_COUNTING_ON scheme_type_table_count += n; scheme_misc_count += (allocmax * sizeof(char *)); #endif scheme_type_writers = RAW_MALLOC_N(Scheme_Type_Writer, allocmax); n = allocmax * sizeof(Scheme_Type_Writer); memset(scheme_type_writers, 0, n); #ifdef MEMORY_COUNTING_ON scheme_type_table_count += n; #endif scheme_type_equals = RAW_MALLOC_N(Scheme_Equal_Proc, allocmax); n = allocmax * sizeof(Scheme_Equal_Proc); memset(scheme_type_equals, 0, n); scheme_type_hash1s = RAW_MALLOC_N(Scheme_Primary_Hash_Proc, allocmax); n = allocmax * sizeof(Scheme_Primary_Hash_Proc); memset(scheme_type_hash1s, 0, n); scheme_type_hash2s = RAW_MALLOC_N(Scheme_Secondary_Hash_Proc, allocmax); n = allocmax * sizeof(Scheme_Secondary_Hash_Proc); memset(scheme_type_hash2s, 0, n); }
Scheme_Place_Async_Channel *scheme_place_async_channel_create() { Scheme_Object **msgs; Scheme_Place_Async_Channel *ch; void **msg_memory; ch = GC_master_malloc_tagged(sizeof(Scheme_Place_Async_Channel)); msgs = GC_master_malloc(sizeof(Scheme_Object*) * 8); msg_memory = GC_master_malloc(sizeof(void*) * 8); ch->so.type = scheme_place_async_channel_type; ch->in = 0; ch->out = 0; ch->count = 0; ch->size = 8; mzrt_mutex_create(&ch->lock); ch->msgs = msgs; ch->msg_memory = msg_memory; ch->wakeup_signal = NULL; return ch; }
void init_master_btc_locks() { mzrt_mutex_create(&master_btc_lock); mzrt_sema_create(&master_btc_sema, 0); }