Skip to content

Commit 8adcde5

Browse files
committed
gh-154431: Use existing runtime->audit_hooks.mutex instead of a new one
1 parent 3479e45 commit 8adcde5

3 files changed

Lines changed: 1 addition & 3 deletions

File tree

Include/internal/pycore_interp_structs.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,6 @@ struct _is {
977977
struct _obmalloc_state *obmalloc;
978978

979979
PyObject *audit_hooks;
980-
PyMutex audit_hooks_mutex;
981980
PyType_WatchCallback type_watchers[TYPE_MAX_WATCHERS];
982981
PyCode_WatchCallback code_watchers[CODE_MAX_WATCHERS];
983982
PyContext_WatchCallback context_watchers[CONTEXT_MAX_WATCHERS];

Python/pystate.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,6 @@ init_interpreter(PyInterpreterState *interp,
578578
llist_init(&interp->mem_free_queue.head);
579579
llist_init(&interp->asyncio_tasks_head);
580580
interp->asyncio_tasks_lock = (PyMutex){0};
581-
interp->audit_hooks_mutex = (PyMutex){0};
582581
for (int i = 0; i < _PY_MONITORING_UNGROUPED_EVENTS; i++) {
583582
interp->monitors.tools[i] = 0;
584583
}

Python/sysmodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -537,7 +537,7 @@ sys_addaudithook_impl(PyObject *module, PyObject *hook)
537537
}
538538

539539
PyInterpreterState *interp = tstate->interp;
540-
PyMutex mutex = interp->audit_hooks_mutex;
540+
PyMutex mutex = interp->runtime->audit_hooks.mutex;
541541
PyMutex_Lock(&mutex);
542542

543543
if (interp->audit_hooks == NULL) {

0 commit comments

Comments
 (0)