We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13db9a9 commit 37287baCopy full SHA for 37287ba
1 file changed
Python/perf_jit_trampoline.c
@@ -577,6 +577,14 @@ static void perf_map_jit_write_entry_with_name(
577
PyMem_RawFree(perf_map_entry);
578
return;
579
}
580
+
581
+ /*
582
+ * A logical jitdump entry is written as multiple records and also consumes
583
+ * a process-global code_id. Serialize the whole sequence so concurrent JIT
584
+ * compilation cannot interleave records or reuse an ID.
585
+ */
586
+ PyThread_acquire_lock(perf_jit_map_state.map_lock, 1);
587
588
/*
589
* Write Code Unwinding Information Event
590
*
@@ -691,6 +699,7 @@ static void perf_map_jit_write_entry_with_name(
691
699
692
700
693
701
/* Clean up allocated memory */
702
+ PyThread_release_lock(perf_jit_map_state.map_lock);
694
703
695
704
696
705
0 commit comments