From 976d6428a53aa58cc3538f03371405693a56d5b3 Mon Sep 17 00:00:00 2001 From: Prem Chintalapudi Date: Tue, 4 Oct 2022 01:54:32 -0400 Subject: [PATCH] Don't remove the typeinf lock functions --- src/gf.c | 12 ++++++++++++ src/jl_exported_funcs.inc | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/gf.c b/src/gf.c index 308f07cb67a65..220b8f84816e5 100644 --- a/src/gf.c +++ b/src/gf.c @@ -3370,6 +3370,8 @@ int jl_has_concrete_subtype(jl_value_t *typ) return ((jl_datatype_t*)typ)->has_concrete_subtype; } +#define typeinf_lock jl_codegen_lock + static jl_mutex_t inference_timing_mutex; static uint64_t inference_start_time = 0; static uint8_t inference_is_measuring_compile_time = 0; @@ -3394,6 +3396,16 @@ JL_DLLEXPORT void jl_typeinf_timing_end(void) JL_UNLOCK_NOGC(&inference_timing_mutex); } +JL_DLLEXPORT void jl_typeinf_lock_begin(void) +{ + JL_LOCK(&typeinf_lock); +} + +JL_DLLEXPORT void jl_typeinf_lock_end(void) +{ + JL_UNLOCK(&typeinf_lock); +} + #ifdef __cplusplus } #endif diff --git a/src/jl_exported_funcs.inc b/src/jl_exported_funcs.inc index 8f5970ad81ee9..b17251d4a5af3 100644 --- a/src/jl_exported_funcs.inc +++ b/src/jl_exported_funcs.inc @@ -478,6 +478,8 @@ XX(jl_tty_set_mode) \ XX(jl_tupletype_fill) \ XX(jl_typeassert) \ + XX(jl_typeinf_lock_begin) \ + XX(jl_typeinf_lock_end) \ XX(jl_typeinf_timing_begin) \ XX(jl_typeinf_timing_end) \ XX(jl_typename_str) \