diff options
author | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2010-09-20 02:11:49 +0000 |
---|---|---|
committer | Kristján Valur Jónsson <kristjan@ccpgames.com> | 2010-09-20 02:11:49 +0000 |
commit | 4a6fcda50b929b61836ed82e57937dec5d47961a (patch) | |
tree | 6b7363d25b407aeb638b91055592894d84122ed2 /Python/pystate.c | |
parent | 3a6e237d50e392fe1d864c8140442e75c3aeaa64 (diff) | |
download | cpython-4a6fcda50b929b61836ed82e57937dec5d47961a.tar.gz |
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.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index 77534fc12f..d5d98b0c6d 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); |