Eric Snow
f5198b09e1
gh-109860: Use a New Thread State When Switching Interpreters, When Necessary (gh-110245)
...
In a few places we switch to another interpreter without knowing if it has a thread state associated with the current thread. For the main interpreter there wasn't much of a problem, but for subinterpreters we were *mostly* okay re-using the tstate created with the interpreter (located via PyInterpreterState_ThreadHead()). There was a good chance that tstate wasn't actually in use by another thread.
However, there are no guarantees of that. Furthermore, re-using an already used tstate is currently fragile. To address this, now we create a new thread state in each of those places and use it.
One consequence of this change is that PyInterpreterState_ThreadHead() may not return NULL (though that won't happen for the main interpreter).
2023-10-03 09:20:48 -06:00
..
2023-09-06 15:54:59 +00:00
2022-10-17 12:01:00 +02:00
2022-10-17 12:01:00 +02:00
2023-08-24 23:35:47 +00:00
2023-09-27 15:27:44 -07:00
2022-11-09 10:50:09 -08:00
2022-10-25 23:34:22 +01:00
2023-08-25 01:01:30 +02:00
2023-09-08 09:48:28 +00:00
2023-02-28 14:16:39 -07:00
2023-09-13 09:00:39 -07:00
2023-09-30 20:06:45 +00:00
2023-09-30 22:21:20 +00:00
2023-09-28 15:31:32 +01:00
2023-09-19 15:01:34 -06:00
2023-09-13 10:25:45 -07:00
2023-09-13 10:25:45 -07:00
2023-09-03 18:54:27 +02:00
2023-09-14 17:06:08 +01:00
2023-09-30 19:25:54 +02:00
2023-08-04 16:24:50 -07:00
2023-09-29 10:56:49 +02:00
2023-09-02 16:50:18 +02:00
2023-02-15 15:32:31 -07:00
2023-09-27 15:24:12 +00:00
2023-09-08 17:54:45 +01:00
2023-09-15 15:04:21 -07:00
2023-09-29 10:56:49 +02:00
2023-09-28 15:31:32 +01:00
2023-09-04 11:36:57 +01:00
2023-09-30 20:06:45 +00:00
2023-09-28 20:33:28 +01:00
2023-06-02 01:33:17 +02:00
2023-08-31 09:56:06 +02:00
2023-09-08 10:34:40 +01:00
2023-09-30 20:06:45 +00:00
2023-07-03 22:35:46 +00:00
2023-09-28 15:31:32 +01:00
2023-09-29 10:56:49 +02:00
2023-01-08 09:13:25 -06:00
2023-09-29 10:56:49 +02:00
2022-11-15 09:45:11 -07:00
2023-08-24 18:53:50 +02:00
2023-08-31 18:33:34 +02:00
2023-09-29 10:56:49 +02:00
2023-07-03 10:48:50 +00:00
2023-06-29 17:20:49 -07:00
2023-10-02 19:59:05 +00:00
2023-09-22 14:13:31 -07:00
2023-09-06 15:56:08 +02:00
2023-09-06 15:56:08 +02:00
2023-09-19 09:54:29 -06:00
2023-07-22 17:04:34 +02:00
2023-07-18 09:42:05 +03:00
2022-10-07 11:49:53 -07:00
2023-09-03 18:54:27 +02:00
2023-09-13 10:25:45 -07:00
2023-08-23 18:39:00 +01:00
2023-09-13 10:26:50 -07:00
2023-09-19 09:54:29 -06:00
2023-09-29 10:56:49 +02:00
2023-09-06 15:56:08 +02:00
2023-07-04 09:41:43 +00:00
2023-09-29 10:56:49 +02:00
2023-10-03 09:20:48 -06:00
2023-10-03 09:20:48 -06:00
2023-09-01 18:36:53 +02:00
2023-09-02 23:15:54 +02:00
2023-09-06 15:56:08 +02:00
2023-09-08 09:48:28 +00:00
2023-07-26 16:34:15 +01:00
2023-09-29 10:56:49 +02:00
2023-09-02 17:51:19 +02:00
2023-09-13 10:25:45 -07:00
2023-06-19 23:47:04 +01:00
2023-07-25 15:28:30 +02:00
2023-09-17 14:23:31 +03:00
2023-09-20 10:55:56 -06:00
2023-09-30 20:06:45 +00:00
2022-12-08 17:50:58 -07:00
2023-09-06 15:56:08 +02:00
2023-09-30 19:25:54 +02:00
2023-09-30 19:25:54 +02:00
2023-09-30 20:06:45 +00:00
2023-09-06 15:56:08 +02:00