[3.13] gh-137093: Fix race condition in `test_embed.test_bpo20891` (GH-137094) (GH-140524) (#140527)
[3.14] gh-137093: Fix race condition in `test_embed.test_bpo20891` (GH-137094) (GH-140524)
Use a `PyEvent` instead of a lock to fix a race on the free-threaded build.
(cherry picked from commit
9b451fb457a5de9ed535a0e2f41161dfaa9a419a)
(cherry picked from commit
6efd78d7ab01c5daf2197c8c9e8f2db046e6d8f1)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>