summaryrefslogtreecommitdiff
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-12-21 18:27:28 +0000
committerGuido van Rossum <guido@python.org>1998-12-21 18:27:28 +0000
commit18bc7c227676c91a6cfe97cd571bd0a5a187e373 (patch)
tree6494ce4102748da6575cb75f676de1f02a1bfb21 /Python/pystate.c
parentdfaac4df9efb59d9469f04d2f583399172fa1112 (diff)
downloadcpython-git-18bc7c227676c91a6cfe97cd571bd0a5a187e373.tar.gz
Make current_tstate a global, _PyThreadState_Current. This is to
support a macro in pystate.h.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index e74e34ca4a..338c0c31df 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -42,7 +42,7 @@ PERFORMANCE OF THIS SOFTWARE.
static PyInterpreterState *interp_head = NULL;
-static PyThreadState *current_tstate = NULL;
+PyThreadState *_PyThreadState_Current = NULL;
PyInterpreterState *
@@ -180,7 +180,7 @@ PyThreadState_Delete(tstate)
PyThreadState **p;
if (tstate == NULL)
Py_FatalError("PyThreadState_Delete: NULL tstate");
- if (tstate == current_tstate)
+ if (tstate == _PyThreadState_Current)
Py_FatalError("PyThreadState_Delete: tstate is still current");
interp = tstate->interp;
if (interp == NULL)
@@ -200,10 +200,10 @@ PyThreadState_Delete(tstate)
PyThreadState *
PyThreadState_Get()
{
- if (current_tstate == NULL)
+ if (_PyThreadState_Current == NULL)
Py_FatalError("PyThreadState_Get: no current thread");
- return current_tstate;
+ return _PyThreadState_Current;
}
@@ -211,9 +211,9 @@ PyThreadState *
PyThreadState_Swap(new)
PyThreadState *new;
{
- PyThreadState *old = current_tstate;
+ PyThreadState *old = _PyThreadState_Current;
- current_tstate = new;
+ _PyThreadState_Current = new;
return old;
}
@@ -227,10 +227,10 @@ PyThreadState_Swap(new)
PyObject *
PyThreadState_GetDict()
{
- if (current_tstate == NULL)
+ if (_PyThreadState_Current == NULL)
Py_FatalError("PyThreadState_GetDict: no current thread");
- if (current_tstate->dict == NULL)
- current_tstate->dict = PyDict_New();
- return current_tstate->dict;
+ if (_PyThreadState_Current->dict == NULL)
+ _PyThreadState_Current->dict = PyDict_New();
+ return _PyThreadState_Current->dict;
}