| 2099 | } |
| 2100 | |
| 2101 | void ClientRequestState::WaitForCompletionExecState() { |
| 2102 | if (query_options().long_polling_time_ms <= 0) return; |
| 2103 | int64_t timeout_us = query_options().long_polling_time_ms * MICROS_PER_MILLI; |
| 2104 | unique_lock<mutex> l(exec_state_lock_); |
| 2105 | timespec deadline; |
| 2106 | TimeFromNowMicros(timeout_us, &deadline); |
| 2107 | bool timed_out = false; |
| 2108 | while (exec_state() != ExecState::FINISHED && |
| 2109 | exec_state() != ExecState::ERROR && |
| 2110 | !timed_out) { |
| 2111 | timed_out = !exec_state_cv_.WaitUntil(l, deadline); |
| 2112 | } |
| 2113 | } |
| 2114 | |
| 2115 | TOperationState::type ClientRequestState::TOperationState() const { |
| 2116 | switch (exec_state()) { |
no test coverage detected