diff Python/pystate.c @ 64844:8e428b8e7d81

issue 9786 Native TLS support for pthreads PyThread_create_key now has a failure mode that the applicatino can detect.
author Kristján Valur Jónsson <kristjan@ccpgames.com>
date Mon, 20 Sep 2010 02:11:49 +0000
parents 851672498fe5
children 3c9232a684ae
line wrap: on
line diff
--- a/Python/pystate.c	Mon Sep 20 01:33:21 2010 +0000
+++ b/Python/pystate.c	Mon Sep 20 02:11:49 2010 +0000
@@ -569,6 +569,8 @@
 {
     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);