diff options
Diffstat (limited to 'Python/pystate.c')
-rw-r--r-- | Python/pystate.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index 9a41ccf..faf55f1 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -35,6 +35,7 @@ static PyThread_type_lock head_mutex = NULL; /* Protects interp->tstate_head */ static PyInterpreterState *interp_head = NULL; PyThreadState *_PyThreadState_Current = NULL; +unaryfunc _PyThreadState_GetFrame = NULL; PyInterpreterState * @@ -114,10 +115,19 @@ PyInterpreterState_Delete(PyInterpreterState *interp) } +/* Default implementation for _PyThreadState_GetFrame */ +static struct _frame * +threadstate_getframe(PyThreadState *self) +{ + return self->frame; +} + PyThreadState * PyThreadState_New(PyInterpreterState *interp) { PyThreadState *tstate = PyMem_NEW(PyThreadState, 1); + if (_PyThreadState_GetFrame == NULL) + _PyThreadState_GetFrame = (unaryfunc)threadstate_getframe; if (tstate != NULL) { tstate->interp = interp; |