diff options
Diffstat (limited to 'Python/ceval_gil.h')
-rw-r--r-- | Python/ceval_gil.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/ceval_gil.h b/Python/ceval_gil.h index bf7a350..e7764f2 100644 --- a/Python/ceval_gil.h +++ b/Python/ceval_gil.h @@ -313,13 +313,14 @@ static void create_gil(void) static void destroy_gil(void) { - MUTEX_FINI(gil_mutex); -#ifdef FORCE_SWITCHING - MUTEX_FINI(switch_mutex); -#endif + /* some pthread-like implementations tie the mutex to the cond + * and must have the cond destroyed first. + */ COND_FINI(gil_cond); + MUTEX_FINI(gil_mutex); #ifdef FORCE_SWITCHING COND_FINI(switch_cond); + MUTEX_FINI(switch_mutex); #endif _Py_atomic_store_explicit(&gil_locked, -1, _Py_memory_order_release); _Py_ANNOTATE_RWLOCK_DESTROY(&gil_locked); |