Warning · Concurrency
Impact
During backoff, `set()` can complete a foreign-loop future on the wrong thread and raise `RuntimeError` with asyncio debug checks enabled.
Recommended action
Hold the same lock across the foreign-loop check, waiter insertion, and waiter removal.