Warning · Api contract
Impact
If polling resumes after the deadline, it returns `TIMED_OUT` instead of `STOPPED`.
Recommended action
Race the full `wait()` against the deadline and latch its successful completion before the cutoff independently of when polling resumes.