mirror of
https://github.com/python/cpython.git
synced 2025-08-02 08:02:56 +00:00
You can have more than one thread state for a thread if they
correspond to different interpreters (I hope, please revert if this is wrong :).
This commit is contained in:
parent
b5e7ff4aeb
commit
867f2d45cd
1 changed files with 1 additions and 1 deletions
|
@ -289,7 +289,7 @@ PyThreadState_Swap(PyThreadState *new)
|
||||||
#if defined(Py_DEBUG) && defined(WITH_THREAD)
|
#if defined(Py_DEBUG) && defined(WITH_THREAD)
|
||||||
if (new) {
|
if (new) {
|
||||||
PyThreadState *check = PyGILState_GetThisThreadState();
|
PyThreadState *check = PyGILState_GetThisThreadState();
|
||||||
if (check && check != new)
|
if (check && check->interp == new->interp && check != new)
|
||||||
Py_FatalError("Invalid thread state for this thread");
|
Py_FatalError("Invalid thread state for this thread");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue