This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neologix
Recipients grahamd, neologix, pitrou
Date 2011-10-12.08:32:28
SpamBayes Score 7.646939e-12
Marked as misclassified No
Message-id <CAH_1eM0kTE8B4ebAGCjBbwEmEnTKxhwSAcG5+KpRd9w-4SV_wA@mail.gmail.com>
In-reply-to <1318403404.41.0.321628142654.issue13156@psf.upfronthosting.co.za>
Content
> 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.
History
Date User Action Args
2011-10-12 08:32:33neologixsetrecipients: + neologix, pitrou, grahamd
2011-10-12 08:32:30neologixlinkissue13156 messages
2011-10-12 08:32:28neologixcreate