mirror of
https://github.com/python/cpython.git
synced 2025-11-03 19:34:08 +00:00
gh-99113: Add PyInterpreterConfig.own_gil (gh-104204)
We also add PyInterpreterState.ceval.own_gil to record if the interpreter actually has its own GIL. Note that for now we don't actually respect own_gil; all interpreters still share the one GIL. However, PyInterpreterState.ceval.own_gil does reflect PyInterpreterConfig.own_gil. That lie is a temporary one that we will fix when the GIL really becomes per-interpreter.
This commit is contained in:
parent
66558d2a16
commit
f3e7eb48f8
11 changed files with 79 additions and 18 deletions
|
|
@ -97,7 +97,7 @@ _PyEval_Vector(PyThreadState *tstate,
|
|||
PyObject *kwnames);
|
||||
|
||||
extern int _PyEval_ThreadsInitialized(void);
|
||||
extern PyStatus _PyEval_InitGIL(PyThreadState *tstate);
|
||||
extern PyStatus _PyEval_InitGIL(PyThreadState *tstate, int own_gil);
|
||||
extern void _PyEval_FiniGIL(PyInterpreterState *interp);
|
||||
|
||||
extern void _PyEval_ReleaseLock(PyThreadState *tstate);
|
||||
|
|
|
|||
|
|
@ -86,6 +86,7 @@ struct _pending_calls {
|
|||
struct _ceval_state {
|
||||
int recursion_limit;
|
||||
struct _gil_runtime_state *gil;
|
||||
int own_gil;
|
||||
/* This single variable consolidates all requests to break out of
|
||||
the fast path in the eval loop. */
|
||||
_Py_atomic_int eval_breaker;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue