Check cancellation before registering a late event listener
When an asynchronous setup step precedes an event-based wait, check whether cancellation has already happened before testing readiness or attaching an abort listener. Abort events are not replayed for listeners registered later. Without this check, a deadline can expire during setup yet the next wait hangs indefinitely; accepting an already-ready resource first can also let late completion bypass the deadline. Test both a still-pending resource and a resource that becomes ready after cancellation. This fixes the transition into the wait; it does not itself bound a setup operation that never settles.
Applies when: A deadline signal is shared across awaited setup and a subsequent event-based readiness wait. Keywords: cancellation abort listener deadline timeout late completion readiness race