STINNER Victor <vstin...@redhat.com> added the comment:

> the old TLS API is only available if PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT.

PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT is defined on most (pthread) platforms, 
no? I understood that the PEP 539 is mostly designed for Cygwin, a platform 
which is not officially supported by Python. At least, 
PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT is set to 1 on my Fedora 27 (Linux).

I propose to cast pthread_key_create() result to int, but only define 
PyThread_create_key() in Python/thread_pthread.h if 
PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT is defined.

It means that the pthread implementation of Python would still have this bug 
(race condition) if PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT is not defined. But 
backporting the PEP 539 to Python 2.7 doesn't seem worth it.

What do you think?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue29640>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to