| 29 | |
| 30 | |
| 31 | TInstant TEventWaitQueue::WakeTimedout(TInstant now) noexcept { |
| 32 | TIoWait::TIterator it = IoWait_.Begin(); |
| 33 | |
| 34 | if (it != IoWait_.End()) { |
| 35 | if (it->DeadLine() > now) { |
| 36 | return it->DeadLine(); |
| 37 | } |
| 38 | |
| 39 | do { |
| 40 | (it++)->Wake(ETIMEDOUT); |
| 41 | } while (it != IoWait_.End() && it->DeadLine() <= now); |
| 42 | } |
| 43 | |
| 44 | return now; |
| 45 | } |
| 46 | |
| 47 | void TEventWaitQueue::Register(NCoro::TContPollEvent* event) { |
| 48 | IoWait_.Insert(event); |