From 99fcc616d400cd31af0733c3f8cc93bcc1d32a44 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 29 Apr 2019 13:04:07 +0200 Subject: Revert "bpo-36356: Destroy the GIL at exit (GH-12453)" (GH613006) This reverts commit b36e5d627d4232a01850707eb78a5067f3fd77f4. --- Python/ceval.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'Python/ceval.c') diff --git a/Python/ceval.c b/Python/ceval.c index 5480fbacaf..ccd0427a14 100644 --- a/Python/ceval.c +++ b/Python/ceval.c @@ -188,19 +188,8 @@ PyEval_InitThreads(void) } } - void _PyEval_FiniThreads(void) -{ - if (_PyRuntime.ceval.pending.lock != NULL) { - PyThread_free_lock(_PyRuntime.ceval.pending.lock); - _PyRuntime.ceval.pending.lock = NULL; - } -} - - -void -_PyEval_FiniThreads2(void) { if (!gil_created()) { return; @@ -208,6 +197,11 @@ _PyEval_FiniThreads2(void) destroy_gil(); assert(!gil_created()); + + if (_PyRuntime.ceval.pending.lock != NULL) { + PyThread_free_lock(_PyRuntime.ceval.pending.lock); + _PyRuntime.ceval.pending.lock = NULL; + } } static inline void -- cgit v1.2.1