| 42 | |
| 43 | |
| 44 | CStatus GElementRepository::reset() { |
| 45 | CGRAPH_FUNCTION_BEGIN |
| 46 | for (auto& cur : async_elements_) { |
| 47 | if (GElementTimeoutStrategy::HOLD_BY_PIPELINE == cur->timeout_strategy_) { |
| 48 | // 强烈建议,在这里等待执行完成 |
| 49 | status += cur->getAsyncResult(); |
| 50 | } |
| 51 | |
| 52 | // 无论如何,写回非 timeout状态,确保不会迭代到下一轮 |
| 53 | if (cur->isTimeout()) { |
| 54 | cur->cur_state_.store(GElementState::NORMAL, std::memory_order_release); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | CGRAPH_FUNCTION_END |
| 59 | } |
| 60 | |
| 61 | |
| 62 | CStatus GElementRepository::pushAllState(const GElementState& state) { |