mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
gh-76785: Use Pending Calls When Releasing Cross-Interpreter Data (gh-109556)
This fixes some crashes in the _xxinterpchannels module, due to a race between interpreters.
This commit is contained in:
parent
754519a9f8
commit
fd7e08a6f3
7 changed files with 99 additions and 68 deletions
|
|
@ -11,6 +11,8 @@ extern "C" {
|
|||
#include "pycore_gil.h" // struct _gil_runtime_state
|
||||
|
||||
|
||||
typedef int (*_Py_pending_call_func)(void *);
|
||||
|
||||
struct _pending_calls {
|
||||
int busy;
|
||||
PyThread_type_lock lock;
|
||||
|
|
@ -22,7 +24,7 @@ struct _pending_calls {
|
|||
int async_exc;
|
||||
#define NPENDINGCALLS 32
|
||||
struct _pending_call {
|
||||
int (*func)(void *);
|
||||
_Py_pending_call_func func;
|
||||
void *arg;
|
||||
} calls[NPENDINGCALLS];
|
||||
int first;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue