summaryrefslogtreecommitdiffstats
path: root/Python/pystate.c
diff options
context:
space:
mode:
authorKristján Valur Jónsson <kristjan@ccpgames.com>2010-09-20 02:11:49 (GMT)
committerKristján Valur Jónsson <kristjan@ccpgames.com>2010-09-20 02:11:49 (GMT)
commit2fea9b961d6ea1041ace66037513fcad1fc2173d (patch)
treeb01a6295a2711f72c1a2b5ce94fbfc0372636fc7 /Python/pystate.c
parent3d8580f690d13817af941afe4958576e8d7922af (diff)
downloadcpython-2fea9b961d6ea1041ace66037513fcad1fc2173d.zip
cpython-2fea9b961d6ea1041ace66037513fcad1fc2173d.tar.gz
cpython-2fea9b961d6ea1041ace66037513fcad1fc2173d.tar.bz2
issue 9786 Native TLS support for pthreads
PyThread_create_key now has a failure mode that the applicatino can detect.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r--Python/pystate.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c
index 77534fc..d5d98b0 100644
--- a/Python/pystate.c
+++ b/Python/pystate.c
@@ -569,6 +569,8 @@ _PyGILState_Init(PyInterpreterState *i, PyThreadState *t)
{
assert(i && t); /* must init with valid states */
autoTLSkey = PyThread_create_key();
+ if (autoTLSkey == -1)
+ Py_FatalError("Could not allocate TLS entry");
autoInterpreterState = i;
assert(PyThread_get_key_value(autoTLSkey) == NULL);
assert(t->gilstate_counter == 0);