Charles-François Natali <neolo...@free.fr> added the comment: > So, the documentation you quote is only to do with the main > interpreter and is not how things work for sub interpreters.
You're right, my bad. However, it would probably be better to destroy/reset the autoTLSkey even if the current thread doesn't have an associated TLS key (to avoid stumbling upon the original libc bug of issue #10517): """ void _PyGILState_Reinit(void) { PyThreadState *tstate = PyGILState_GetThisThreadState(); PyThread_delete_key(autoTLSkey); if ((autoTLSkey = PyThread_create_key()) == -1) Py_FatalError("Could not allocate TLS entry"); /* re-associate the current thread state with the new key */ if (tstate && PyThread_set_key_value(autoTLSkey, (void *)tstate) < 0) Py_FatalError("Couldn't create autoTLSkey mapping"); } """ Now that i think about it, the problem is even simpler: this patch shouldn't have been applied to 2.7 and 3.2, it was only relevant for native pthread TLS implementation (which does allow NULL values). So the solution would be simply to backout this patch on 2.7 and 3.2. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue13156> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com