Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pythongh-108724: Fix _PySemaphore_Wait call during thread deletion
In general, when `_PyThreadState_GET()` is non-NULL then the current thread is "attached", but there is a small window during `PyThreadState_DeleteCurrent()` where that's not true: tstate_delete_common is called when the thread is detached, but before current_fast_clear(). This updates _PySemaphore_Wait() to handle that case.
- Loading branch information