Make the in-flight claim test wait for the waiter to park

a_second_claim_waits_for_the_first_to_be_released failed on CI: the
second claim came back Some. The waiter thread signalled the main thread
before calling claim, so the main thread could drop the first guard
before the waiter reached the lock. The path was free by then, and the
waiter claimed it outright.

The registry now keeps a test-only count of threads parked in claim,
bumped under the lock just before the condvar wait. The test spins until
that count is one before releasing. The release needs the same lock, so
it can only reach a waiter that is already waiting. Passed 500 runs in a
row.
This commit is contained in:
2026-09-22 21:12:45 -04:00
parent 7fa3176f88
commit aee355fada
2 changed files with 16 additions and 10 deletions
File diff suppressed because one or more lines are too long