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