Warning · Concurrency
The synchronous wait reads the clock before the event flag, so it can record a post-deadline signal with a pre-deadline timestamp.
Impact
The caller can receive `STOPPED` instead of `TIMED_OUT`.
Recommended action
Check the cutoff after reading the flag, while still honoring any signal already recorded before the deadline.