gh-116664: Make module state Py_SETREF's in _warnings thread-safe by erlend-aasland · Pull Request #116959 · python/cpython · GitHub
Skip to content
Merged
8 changes: 6 additions & 2 deletions Include/internal/pycore_critical_section.h
1 change: 1 addition & 0 deletions Include/internal/pycore_warnings.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct _warnings_runtime_state {
PyObject *filters; /* List */
PyObject *once_registry; /* Dict */
PyObject *default_action; /* String */
struct _PyMutex mutex;
long filters_version;
};

Expand Down
58 changes: 37 additions & 21 deletions Python/_warnings.c