issue 9786 Native TLS support for pthreads

PyThread_create_key now has a failure mode that the applicatino can detect.
This commit is contained in:
Kristján Valur Jónsson 2010-09-20 02:11:49 +00:00
parent 3d8580f690
commit 2fea9b961d
3 changed files with 49 additions and 1 deletions

View file

@ -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);