mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
gh-136421: Load _datetime static types during interpreter initialization (GH-136583)
`_datetime` is a special module, because it's the only non-builtin C extension that contains static types. As such, it would initialize static types in the module's execution function, which can run concurrently. Since static type initialization is not thread-safe, this caused crashes. This fixes it by moving the initialization of `_datetime`'s static types to interpreter startup (where all other static types are initialized), which is already properly protected through other locks.
This commit is contained in:
parent
80b2d60a51
commit
a10960699a
8 changed files with 111 additions and 95 deletions
|
|
@ -55,9 +55,6 @@
|
|||
@MODULE_CMATH_TRUE@cmath cmathmodule.c
|
||||
@MODULE__STATISTICS_TRUE@_statistics _statisticsmodule.c
|
||||
|
||||
# needs libm and on some platforms librt
|
||||
@MODULE__DATETIME_TRUE@_datetime _datetimemodule.c
|
||||
|
||||
# _decimal uses libmpdec
|
||||
# either static libmpdec.a from Modules/_decimal/libmpdec or libmpdec.so
|
||||
# with ./configure --with-system-libmpdec
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue