bpo-45274: Fix one race condition Thread.join by bensimner · Pull Request #31290 · python/cpython

@bensimner

@bensimner

If the tstate lock acquire() fails,
the tstate lock might still be locked,
and the thread still running.