You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
)
* fix: Make gil_safe_call_once thread-safe in free-threaded CPython
The "is_initialized_" flags is not protected by the GIL in free-threaded
Python, so it needs to be an atomic field.
Fixes#5245
* style: pre-commit fixes
* Apply changes from code review
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
)
* fix: Make gil_safe_call_once thread-safe in free-threaded CPython
The "is_initialized_" flags is not protected by the GIL in free-threaded
Python, so it needs to be an atomic field.
Fixes#5245
* style: pre-commit fixes
* Apply changes from code review
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Required prerequisites
What version (or hash if on master) of pybind11 are you using?
0e2c3e5
Problem description
In the function,
pybind11/include/pybind11/gil_safe_call_once.h
Lines 51 to 59 in ccefee4
is_initialized_
is read outside of the critical section without any synchronization. Which can lead to a race in a NoGil build.Reproducible example code
Is this a regression? Put the last known working version here if it is.
Not a regression
The text was updated successfully, but these errors were encountered: