mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
[3.14] gh-128639: Don't assume one thread in subinterpreter finalization with fixed daemon thread support (GH-134606) (GH-139050)
gh-128639: Don't assume one thread in subinterpreter finalization with fixed daemon thread support (GH-134606)
This reapplies GH-128640.
(cherry picked from commit a64881363b)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
This commit is contained in:
parent
08bea299bf
commit
cec4ddf23e
6 changed files with 114 additions and 39 deletions
|
|
@ -1434,9 +1434,12 @@ static int test_audit_subinterpreter(void)
|
|||
PySys_AddAuditHook(_audit_subinterpreter_hook, NULL);
|
||||
_testembed_Py_InitializeFromConfig();
|
||||
|
||||
Py_NewInterpreter();
|
||||
Py_NewInterpreter();
|
||||
Py_NewInterpreter();
|
||||
PyThreadState *tstate = PyThreadState_Get();
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
Py_EndInterpreter(Py_NewInterpreter());
|
||||
PyThreadState_Swap(tstate);
|
||||
}
|
||||
|
||||
Py_Finalize();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue