2016-12-20 22:30 GMT+09:00 Erik Bray <erik.m.b...@gmail.com>: > This is probably an implementation detail, but ISTM that even with > PyThread_call_once, it will be necessary to reset any used once_flags > manually in PyOS_AfterFork, essentially for the same reason the > autoTLSkey is reset there currently... >
Deleting threads key is executed on *_Fini functions, but Py_FinalizeEx function that calls *_Fini functions doesn't terminate CPython interpreter. Furthermore, source comment and document have said description about reinitialization after calling Py_FinalizeEx. [1] [2] That is to say there is an implicit possible that is reinitialization contrary to name "call_once" on a process level. Therefore, if CPython interpreter continues to allow reinitialization, I'd suggest to rename the call_once API to avoid misreading semantics. (for example, safe_init, check_init) Best regards, Masayuki [1] https://hg.python.org/cpython/file/default/Python/pylifecycle.c#l170 [2] https://docs.python.org/dev/c-api/init.html#c.Py_FinalizeEx
_______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/