]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-111924: Use PyMutex for Runtime-global Locks. (gh-112207)
authorSam Gross <colesbury@gmail.com>
Thu, 7 Dec 2023 19:33:40 +0000 (14:33 -0500)
committerGitHub <noreply@github.com>
Thu, 7 Dec 2023 19:33:40 +0000 (12:33 -0700)
commitcf6110ba1337cb67e5867d86e7c0e8d923a5bc8d
treeab8393161d5ce01479bfb03dce874ab52246d28f
parentdb460735af7503984d1b7d878069722db44b11e8
gh-111924: Use PyMutex for Runtime-global Locks. (gh-112207)

This replaces some usages of PyThread_type_lock with PyMutex, which does not require memory allocation to initialize.

This simplifies some of the runtime initialization and is also one step towards avoiding changing the default raw memory allocator during initialize/finalization, which can be non-thread-safe in some circumstances.
18 files changed:
Include/internal/pycore_atexit.h
Include/internal/pycore_ceval.h
Include/internal/pycore_ceval_state.h
Include/internal/pycore_crossinterp.h
Include/internal/pycore_import.h
Include/internal/pycore_lock.h
Include/internal/pycore_pymem.h
Include/internal/pycore_pystate.h
Include/internal/pycore_runtime.h
Include/internal/pycore_unicodeobject.h
Objects/obmalloc.c
Objects/unicodeobject.c
Python/ceval_gil.c
Python/crossinterp.c
Python/import.c
Python/pylifecycle.c
Python/pystate.c
Python/sysmodule.c