Skip to content

Commit 2027de6

Browse files
authored
Add a note that holding the GIL is not required for these APIs
1 parent d245fbf commit 2027de6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Doc/c-api/perfmaps.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,16 @@ kernel/git/torvalds/linux.git/tree/tools/perf/Documentation/jit-interface.txt>`_
1616
In Python, these helper APIs can be used by libraries and features that rely
1717
on generating machine code on the fly.
1818

19+
Note that holding the Global Interpreter Lock (GIL) is not required for these APIs.
20+
1921
.. c:function:: int PyUnstable_PerfMapState_Init(void)
2022
2123
Open the ``/tmp/perf-$pid.map`` file, unless it's already opened, and create
2224
a lock to ensure thread-safe writes to the file (provided the writes are
2325
done through :c:func:`PyUnstable_WritePerfMapEntry`). Normally, there's no need
2426
to call this explicitly, and it is safe to directly use :c:func:`PyUnstable_WritePerfMapEntry`
2527
in your code. If the state isn't already initialized, it will be created on
26-
the first call.
28+
the first call.
2729
2830
.. c:function:: int PyUnstable_WritePerfMapEntry(const void *code_addr, unsigned int code_size, const char *entry_name)
2931

0 commit comments

Comments
 (0)