| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
- Checkout numpy/testing/_private/utils.py - Checkout numpy/_core/tests/test_multithreading.py - Checkout conftest.py - Update test_requirements.txt
| Back | FazBrowse Home | New Git URL |
Backport of #28290.
Fixes #28048
Locks castingimpls with a critical section when the castingimpls cache is empty before writing to the dict.
Because the critical section macros have braces, I refactored PyArray_GetCastingImpl into three functions that call each other. Only the "middle" function needs the critical section, so that reduces the pain of not being able to early return in a critical section a little bit.
I also added some comments because this took me quite a while to fully understand so future readers will hopefully be less confused.
Edit: there are also some unrelated fixes for the test infrastructure to avoid CI crashes and generate better debug output from CI jobs. Happy to do those separately if anyone requests.