aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/context.c
diff options
context:
space:
mode:
authorDonghee Na <donghee.na@python.org>2024-02-02 05:53:53 +0900
committerGitHub <noreply@github.com>2024-02-01 20:53:53 +0000
commit13907968d73b3b602c81e240fb7892a2627974d6 (patch)
tree1113a242a55c14484f81d0997a167cacc5e42da1 /Python/context.c
parent587d4802034749e2aace9c00b00bd73eccdae1e7 (diff)
downloadcpython-13907968d73b3b602c81e240fb7892a2627974d6.tar.gz
cpython-13907968d73b3b602c81e240fb7892a2627974d6.zip
gh-111968: Use per-thread freelists for dict in free-threading (gh-114323)
Diffstat (limited to 'Python/context.c')
-rw-r--r--Python/context.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Python/context.c b/Python/context.c
index 294485e5b40..793dfa2b72c 100644
--- a/Python/context.c
+++ b/Python/context.c
@@ -1287,7 +1287,11 @@ _PyContext_ClearFreeList(_PyFreeListState *freelist_state, int is_finalization)
void
_PyContext_Fini(_PyFreeListState *state)
{
+ // With Py_GIL_DISABLED:
+ // the freelists for the current thread state have already been cleared.
+#ifndef Py_GIL_DISABLED
_PyContext_ClearFreeList(state, 1);
+#endif
}