Skip to content

Commit

Permalink
Don't remove the typeinf lock functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pchintalapudi committed Oct 4, 2022
1 parent a3a9d0b commit 976d642
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/gf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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
2 changes: 2 additions & 0 deletions src/jl_exported_funcs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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) \
Expand Down

0 comments on commit 976d642

Please sign in to comment.