summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-06-08 19:27:44 (GMT)
committerGitHub <noreply@github.com>2023-06-08 19:27:44 (GMT)
commit2ad2bd8b14505ee92600e7988379cfac63086dab (patch)
treea748f316ac0de4688a5f18e19073bb4917ffb3fe /Include
parent8698fa83f6c226d35af0367e40dd4387fcccbe40 (diff)
downloadcpython-2ad2bd8b14505ee92600e7988379cfac63086dab.zip
cpython-2ad2bd8b14505ee92600e7988379cfac63086dab.tar.gz
cpython-2ad2bd8b14505ee92600e7988379cfac63086dab.tar.bz2
[3.12] gh-100227: Lock Around Use of the Global "atexit" State (gh-105514) (gh-105517)
The risk of a race with this state is relatively low, but we play it safe anyway. (cherry picked from commit 7799c8e678f759c7787785c6287140abe641d1b9) Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Diffstat (limited to 'Include')
-rw-r--r--Include/internal/pycore_atexit.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/Include/internal/pycore_atexit.h b/Include/internal/pycore_atexit.h
index b4663b3..63a2cd5 100644
--- a/Include/internal/pycore_atexit.h
+++ b/Include/internal/pycore_atexit.h
@@ -15,6 +15,7 @@ extern "C" {
typedef void (*atexit_callbackfunc)(void);
struct _atexit_runtime_state {
+ PyThread_type_lock mutex;
#define NEXITFUNCS 32
atexit_callbackfunc callbacks[NEXITFUNCS];
int ncallbacks;