summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorEric Snow <ericsnowcurrently@gmail.com>2023-06-08 21:05:47 (GMT)
committerGitHub <noreply@github.com>2023-06-08 21:05:47 (GMT)
commitb08ea9a561e93e421e55b6eba5da350e6919708e (patch)
treeb397169c3d13eb9554750ee3d747a1d9a826d5be /Include
parent2ad2bd8b14505ee92600e7988379cfac63086dab (diff)
downloadcpython-b08ea9a561e93e421e55b6eba5da350e6919708e.zip
cpython-b08ea9a561e93e421e55b6eba5da350e6919708e.tar.gz
cpython-b08ea9a561e93e421e55b6eba5da350e6919708e.tar.bz2
[3.12] gh-100227: Lock Around Adding Global Audit Hooks (gh-105515) (gh-105525)
The risk of a race with this state is relatively low, but we play it safe anyway. (cherry picked from commit e822a676f1f3bef6c5413e9b856db481c08ac2a5)
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_runtime.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Include/internal/pycore_runtime.h b/Include/internal/pycore_runtime.h
index 6e06e87..8f51e2d 100644
--- a/Include/internal/pycore_runtime.h
+++ b/Include/internal/pycore_runtime.h
@@ -143,7 +143,10 @@ typedef struct pyruntimestate {
// is called multiple times.
Py_OpenCodeHookFunction open_code_hook;
void *open_code_userdata;
- _Py_AuditHookEntry *audit_hook_head;
+ struct {
+ PyThread_type_lock mutex;
+ _Py_AuditHookEntry *head;
+ } audit_hooks;
struct _py_object_runtime_state object_state;
struct _Py_float_runtime_state float_state;