/* {MUTEX}.eif_thr_mutex_create */ EIF_TYPED_VALUE F141_1962 (EIF_REFERENCE Current) { GTCX char *l_feature_name = "eif_thr_mutex_create"; RTEX; EIF_POINTER Result = ((EIF_POINTER) 0); RTSN; RTDA; RTLD; RTLI(1); RTLR(0,Current); RTLU (SK_POINTER, &Result); RTLU (SK_REF, &Current); RTEAA(l_feature_name, 140, Current, 0, 0, 2496); RTSA(Dtype(Current)); RTSC; RTME(Dtype(Current), 1); RTDBGEAA(140, Current, 2496); RTIV(Current, RTAL);Result = (EIF_POINTER) eif_thr_mutex_create(); RTVI(Current, RTAL); RTRS; RTHOOK(1); RTDBGLE; RTMD(1); RTLE; RTLO(2); RTEE; { EIF_TYPED_VALUE r; r.type = SK_POINTER; r.it_p = Result; return r; } }
rt_public void once_init (void) { EIF_GET_CONTEXT #if !defined(WORKBENCH) && !defined (EIF_THREADS) int32 old_egc_prof_enabled = egc_prof_enabled; /* Save profiler status */ egc_prof_enabled = 0; /* Disable profiler as it is not initialized yet. */ #endif ALLOC_ONCE_INDEXES; /* Allocate array of once indexes. */ egc_system_mod_init (); /* Assign once indexes. */ #if !defined(WORKBENCH) && !defined (EIF_THREADS) egc_prof_enabled = old_egc_prof_enabled; /* Restore profiler status. */ #endif if (!debug_mode) { /* Once indexes could be used by debugger, * but we are not under debugger at the moment. */ FREE_ONCE_INDEXES; /* Free once indexes. */ } /* Allocate room for once manifest strings array. */ ALLOC_OMS (EIF_oms); if (EIF_once_count == 0) { EIF_once_values = (EIF_once_value_t *) 0; } else { /* Allocate room for once values. */ EIF_once_values = (EIF_once_value_t *) eif_realloc (EIF_once_values, EIF_once_count * sizeof *EIF_once_values); /* needs malloc; crashes otherwise on some pure C-ansi compiler (SGI)*/ if (EIF_once_values == (EIF_once_value_t *) 0) /* Out of memory */ enomem(); memset (EIF_once_values, 0, EIF_once_count * sizeof *EIF_once_values); } #ifdef EIF_THREADS if (EIF_process_once_count == 0) { EIF_process_once_values = (EIF_process_once_value_t *) 0; } else { /* Allocate room for process-relative once values. */ EIF_process_once_values = (EIF_process_once_value_t *) eif_realloc (EIF_process_once_values, EIF_process_once_count * sizeof *EIF_process_once_values); /* needs malloc; crashes otherwise on some pure C-ansi compiler (SGI)*/ if (EIF_process_once_values == (EIF_process_once_value_t *) 0) /* Out of memory */ enomem(); memset (EIF_process_once_values, 0, EIF_process_once_count * sizeof *EIF_process_once_values); { int i = EIF_process_once_count; while (i > 0) { i--; EIF_process_once_values [i].mutex = eif_thr_mutex_create (); } } } #endif }