Martin v. Löwis <mar...@v.loewis.de> added the comment: Am 13.09.2010 10:00, schrieb Kristján Valur Jónsson: > > Kristján Valur Jónsson <krist...@ccpgames.com> added the comment: > > I've changed the function as you suggest, although there are in fact no > failure detection semantics defined for PyThread_create_key().
Right. That's why I'm thinking that we should introduce some. TLS creation *can* fail, and it is unfortunate that the original introduction of this API forgot to consider that. Your patch did (de facto) introduce an error return code (originally 0, now -1). So it would be good if this was documented, and the NT version adjusted. In principle, this is really difficult to get right. AFAICT, pthread_key_t doesn't even have to be an integral type, and even if it is, it may well become -1. However, we can probably worry about this when a system comes along where this implementation breaks. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue9786> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com