We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3224429 commit e8225abCopy full SHA for e8225ab
1 file changed
Python/pystate.c
@@ -1682,6 +1682,10 @@ PyThreadState_Clear(PyThreadState *tstate)
1682
"PyThreadState_Clear: warning: thread still has a generator\n");
1683
}
1684
1685
+#ifdef Py_GIL_DISABLED
1686
+ PyMutex_Lock(&_PyRuntime.ceval.sys_trace_profile_mutex);
1687
+#endif
1688
+
1689
if (tstate->c_profilefunc != NULL) {
1690
tstate->interp->sys_profiling_threads--;
1691
tstate->c_profilefunc = NULL;
@@ -1690,6 +1694,11 @@ PyThreadState_Clear(PyThreadState *tstate)
1694
tstate->interp->sys_tracing_threads--;
1695
tstate->c_tracefunc = NULL;
1692
1696
1697
1698
1699
+ PyMutex_Unlock(&_PyRuntime.ceval.sys_trace_profile_mutex);
1700
1701
1693
1702
Py_CLEAR(tstate->c_profileobj);
1703
Py_CLEAR(tstate->c_traceobj);
1704
0 commit comments