_PyEval_FiniThreads() now free the pending lock.
void
PyEval_InitThreads(void)
{
- if (gil_created())
+ if (gil_created()) {
return;
+ }
+
PyThread_init_thread();
create_gil();
take_gil(_PyThreadState_GET());
void
_PyEval_FiniThreads(void)
{
- if (!gil_created())
+ if (!gil_created()) {
return;
+ }
+
destroy_gil();
assert(!gil_created());
+
+ if (_PyRuntime.ceval.pending.lock != NULL) {
+ PyThread_free_lock(_PyRuntime.ceval.pending.lock);
+ _PyRuntime.ceval.pending.lock = NULL;
+ }
}
void