Currently, self->mutex = (PyMutex){0}; or self->mutex = (PyMutex){_Py_UNLOCKED} pattern is used to initialize statically a PyMutex. It leaks implementation details of PyMutex.
I propose adding PyMutex_STATIC_INIT macro to abstract the initialization. The pattern becomes: self->mutex = PyMutex_STATIC_INIT;.
Linked PRs
Currently,
self->mutex = (PyMutex){0};orself->mutex = (PyMutex){_Py_UNLOCKED}pattern is used to initialize statically aPyMutex. It leaks implementation details ofPyMutex.I propose adding
PyMutex_STATIC_INITmacro to abstract the initialization. The pattern becomes:self->mutex = PyMutex_STATIC_INIT;.Linked PRs