]> granicus.if.org Git - python/commitdiff
You can have more than one thread state for a thread if they
authorMichael W. Hudson <mwh@python.net>
Thu, 16 Jun 2005 11:35:00 +0000 (11:35 +0000)
committerMichael W. Hudson <mwh@python.net>
Thu, 16 Jun 2005 11:35:00 +0000 (11:35 +0000)
correspond to different interpreters (I hope, please revert if this is
wrong :).

Python/pystate.c

index abca8ddfdff1444f3ee9528084ee05c9e28ca302..e2cf7c564d5125ce731b4e9cd2352da8cf8c0d3c 100644 (file)
@@ -289,7 +289,7 @@ PyThreadState_Swap(PyThreadState *new)
 #if defined(Py_DEBUG) && defined(WITH_THREAD)
        if (new) {
                PyThreadState *check = PyGILState_GetThisThreadState();
-               if (check && check != new)
+               if (check && check->interp == new->interp && check != new)
                        Py_FatalError("Invalid thread state for this thread");
        }
 #endif