| 154 | } |
| 155 | |
| 156 | Status Rendezvous::FlowControlRecv(const StringPiece& tag, const ParsedKey& key, |
| 157 | const Args& args, Tensor* val, bool* is_dead, |
| 158 | int64 timeout_ms) { |
| 159 | Status ret; |
| 160 | Notification n; |
| 161 | FlowControlRecvAsync(tag, key, args, [&ret, &n, val, is_dead]( |
| 162 | const Status& s, const Args& send_args, |
| 163 | const Args& recv_args, const Tensor& v, |
| 164 | const bool dead) { |
| 165 | ret = s; |
| 166 | *val = v; |
| 167 | *is_dead = dead; |
| 168 | n.Notify(); |
| 169 | }); |
| 170 | if (timeout_ms > 0) { |
| 171 | int64 timeout_us = timeout_ms * 1000; |
| 172 | bool notified = WaitForNotificationWithTimeout(&n, timeout_us); |
| 173 | if (!notified) { |
| 174 | return Status(error::DEADLINE_EXCEEDED, |
| 175 | "Timed out waiting for notification"); |
| 176 | } |
| 177 | } else { |
| 178 | n.WaitForNotification(); |
| 179 | } |
| 180 | return ret; |
| 181 | } |
| 182 | |
| 183 | Status Rendezvous::FlowControlRecv(const StringPiece& tag, const ParsedKey& key, |
| 184 | const Args& args, Tensor* val, |
no test coverage detected