| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
In the free-threaded build, an atomic load is needed to safely read `tp_flags`, avoiding data races. Replace bit tests on `tp->tp_flags` with calls to `_PyType_HasFeature()`. When multiple bits are being returned as a result of the test, use `PyType_GetFlags()`.
|
Closing as I don't think this is the correct approach. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
In the free-threaded build, an atomic load is needed to safely read tp_flags, avoiding data races. Replace bit tests on tp->tp_flags with calls to _PyType_HasFeature(). When multiple bits are being returned as a result of the test, use PyType_GetFlags().
I think some of these flag tests can safely be a normal load rather than an atomic load. However, it seems better to consistently use _PyType_HasFeature() unless we are sure there is no data race possible.
Implementation notes:
Related PRs: gh-120210 gh-127588