From 2fea9b961d6ea1041ace66037513fcad1fc2173d Mon Sep 17 00:00:00 2001 From: Kristján Valur Jónsson Date: Mon, 20 Sep 2010 02:11:49 +0000 Subject: issue 9786 Native TLS support for pthreads PyThread_create_key now has a failure mode that the applicatino can detect. --- Python/pystate.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Python/pystate.c') diff --git a/Python/pystate.c b/Python/pystate.c index 77534fc12f8..d5d98b0c6d6 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); -- cgit v1.2.3