@@ -343,7 +343,7 @@ int jl_compile_extern_c_impl(LLVMOrcThreadSafeModuleRef llvmmod, void *p, void *
343343 backing = jl_create_ts_module (" cextern" , pparams ? pparams->tsctx : ctx, pparams ? pparams->imaging : imaging_default ());
344344 into = &backing;
345345 }
346- JL_SPIN_LOCK (&jl_codegen_lock);
346+ JL_SLEEP_LOCK (&jl_codegen_lock);
347347 auto target_info = into->withModuleDo ([&](Module &M) {
348348 return std::make_pair (M.getDataLayout (), Triple (M.getTargetTriple ()));
349349 });
@@ -366,7 +366,7 @@ int jl_compile_extern_c_impl(LLVMOrcThreadSafeModuleRef llvmmod, void *p, void *
366366 if (success && llvmmod == NULL )
367367 jl_ExecutionEngine->addModule (std::move (*into));
368368 }
369- JL_SPIN_UNLOCK (&jl_codegen_lock);
369+ JL_SLEEP_UNLOCK (&jl_codegen_lock);
370370 if (timed) {
371371 if (measure_compile_time_enabled) {
372372 auto end = jl_hrtime ();
@@ -439,7 +439,7 @@ jl_code_instance_t *jl_generate_fptr_impl(jl_method_instance_t *mi JL_PROPAGATES
439439 // if we don't have any decls already, try to generate it now
440440 jl_code_info_t *src = NULL ;
441441 JL_GC_PUSH1 (&src);
442- JL_SPIN_LOCK (&jl_codegen_lock); // also disables finalizers, to prevent any unexpected recursion
442+ JL_SLEEP_LOCK (&jl_codegen_lock); // also disables finalizers, to prevent any unexpected recursion
443443 jl_value_t *ci = jl_rettype_inferred (mi, world, world);
444444 jl_code_instance_t *codeinst = (ci == jl_nothing ? NULL : (jl_code_instance_t *)ci);
445445 if (codeinst) {
@@ -482,7 +482,7 @@ jl_code_instance_t *jl_generate_fptr_impl(jl_method_instance_t *mi JL_PROPAGATES
482482 else {
483483 codeinst = NULL ;
484484 }
485- JL_SPIN_UNLOCK (&jl_codegen_lock);
485+ JL_SLEEP_UNLOCK (&jl_codegen_lock);
486486 if (timed) {
487487 if (measure_compile_time_enabled) {
488488 uint64_t t_comp = jl_hrtime () - compiler_start_time;
@@ -511,7 +511,7 @@ void jl_generate_fptr_for_unspecialized_impl(jl_code_instance_t *unspec)
511511 uint8_t measure_compile_time_enabled = jl_atomic_load_relaxed (&jl_measure_compile_time_enabled);
512512 if (measure_compile_time_enabled)
513513 compiler_start_time = jl_hrtime ();
514- JL_SPIN_LOCK (&jl_codegen_lock);
514+ JL_SLEEP_LOCK (&jl_codegen_lock);
515515 if (jl_atomic_load_relaxed (&unspec->invoke ) == NULL ) {
516516 jl_code_info_t *src = NULL ;
517517 JL_GC_PUSH1 (&src);
@@ -538,7 +538,7 @@ void jl_generate_fptr_for_unspecialized_impl(jl_code_instance_t *unspec)
538538 jl_atomic_cmpswap (&unspec->invoke , &null, jl_fptr_interpret_call_addr);
539539 JL_GC_POP ();
540540 }
541- JL_SPIN_UNLOCK (&jl_codegen_lock); // Might GC
541+ JL_SLEEP_UNLOCK (&jl_codegen_lock); // Might GC
542542 if (timed) {
543543 if (measure_compile_time_enabled) {
544544 auto end = jl_hrtime ();
@@ -573,7 +573,7 @@ jl_value_t *jl_dump_method_asm_impl(jl_method_instance_t *mi, size_t world,
573573 uint8_t measure_compile_time_enabled = jl_atomic_load_relaxed (&jl_measure_compile_time_enabled);
574574 if (measure_compile_time_enabled)
575575 compiler_start_time = jl_hrtime ();
576- JL_SPIN_LOCK (&jl_codegen_lock); // also disables finalizers, to prevent any unexpected recursion
576+ JL_SLEEP_LOCK (&jl_codegen_lock); // also disables finalizers, to prevent any unexpected recursion
577577 specfptr = (uintptr_t )jl_atomic_load_relaxed (&codeinst->specptr .fptr );
578578 if (specfptr == 0 ) {
579579 jl_code_info_t *src = jl_type_infer (mi, world, 0 );
@@ -597,7 +597,7 @@ jl_value_t *jl_dump_method_asm_impl(jl_method_instance_t *mi, size_t world,
597597 }
598598 JL_GC_POP ();
599599 }
600- JL_SPIN_UNLOCK (&jl_codegen_lock);
600+ JL_SLEEP_UNLOCK (&jl_codegen_lock);
601601 if (timed) {
602602 if (measure_compile_time_enabled) {
603603 auto end = jl_hrtime ();
0 commit comments