Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pass PyInterpreterState to _PyEval_InitState().
  • Loading branch information
ericsnowcurrently committed Sep 12, 2022
commit 5342672d57a40cd4b24b4b96fd8112cbf5cde9aa
2 changes: 1 addition & 1 deletion Include/internal/pycore_ceval.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct _ceval_runtime_state;

extern void _Py_FinishPendingCalls(PyThreadState *tstate);
extern void _PyEval_InitRuntimeState(struct _ceval_runtime_state *);
extern void _PyEval_InitState(struct _ceval_state *, PyThread_type_lock);
extern void _PyEval_InitState(PyInterpreterState *, PyThread_type_lock);
extern void _PyEval_FiniState(struct _ceval_state *ceval);
PyAPI_FUNC(void) _PyEval_SignalReceived(PyInterpreterState *interp);
PyAPI_FUNC(int) _PyEval_AddPendingCall(
Expand Down
5 changes: 3 additions & 2 deletions Python/ceval_gil.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,11 +908,12 @@ _PyEval_InitRuntimeState(struct _ceval_runtime_state *ceval)
}

void
_PyEval_InitState(struct _ceval_state *ceval, PyThread_type_lock pending_lock)
_PyEval_InitState(PyInterpreterState *interp, PyThread_type_lock pending_lock)
{
struct _ceval_state *ceval = &interp->ceval;

struct _pending_calls *pending = &ceval->pending;
assert(pending->lock == NULL);

pending->lock = pending_lock;
}

Expand Down
2 changes: 1 addition & 1 deletion Python/pystate.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ init_interpreter(PyInterpreterState *interp,
assert(next != NULL || (interp == runtime->interpreters.main));
interp->next = next;

_PyEval_InitState(&interp->ceval, pending_lock);
_PyEval_InitState(interp, pending_lock);
_PyGC_InitState(&interp->gc);
PyConfig_InitPythonConfig(&interp->config);
_PyType_InitCache(interp);
Expand Down