| 6 | class TContCondVar { |
| 7 | public: |
| 8 | int WaitD(TCont* current, TContMutex* mutex, TInstant deadline) { |
| 9 | mutex->UnLock(); |
| 10 | |
| 11 | const int ret = WaitQueue_.WaitD(current, deadline); |
| 12 | |
| 13 | if (ret != EWAKEDUP) { |
| 14 | return ret; |
| 15 | } |
| 16 | |
| 17 | return mutex->LockD(current, deadline); |
| 18 | } |
| 19 | |
| 20 | int WaitT(TCont* current, TContMutex* mutex, TDuration timeout) { |
| 21 | return WaitD(current, mutex, timeout.ToDeadLine()); |