mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
Signal condition variables with the mutex held. Destroy condition variables
before their mutexes.
This commit is contained in:
parent
902274e948
commit
187aa54516
2 changed files with 14 additions and 10 deletions
|
|
@ -313,13 +313,14 @@ static void create_gil(void)
|
|||
|
||||
static void destroy_gil(void)
|
||||
{
|
||||
/* 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
|
||||
MUTEX_FINI(switch_mutex);
|
||||
#endif
|
||||
COND_FINI(gil_cond);
|
||||
#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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue