Mercurial > cpython-lru_cache-weakref
diff Python/pystate.c @ 18733:b0329649b8cf legacy-trunk
Add a low-level API to access interpreters, for David Beazley.
SF patch #436376.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Thu, 19 Jul 2001 12:19:27 +0000 |
| parents | 064de84385ca |
| children | efa9a86464d3 b470b417839d |
line wrap: on
line diff
--- a/Python/pystate.c Thu Jul 19 11:00:41 2001 +0000 +++ b/Python/pystate.c Thu Jul 19 12:19:27 2001 +0000 @@ -264,3 +264,28 @@ _PyThreadState_Current->dict = PyDict_New(); return _PyThreadState_Current->dict; } + + +/* Routines for advanced debuggers, requested by David Beazley. + Don't use unless you know what you are doing! */ + +PyInterpreterState * +PyInterpreterState_Head(void) +{ + return interp_head; +} + +PyInterpreterState * +PyInterpreterState_Next(PyInterpreterState *interp) { + return interp->next; +} + +PyThreadState * +PyInterpreterState_ThreadHead(PyInterpreterState *interp) { + return interp->tstate_head; +} + +PyThreadState * +PyThreadState_Next(PyThreadState *tstate) { + return tstate->next; +}
