MCPcopy Create free account
hub / github.com/ChunelFeng/CGraph / pushAllState

Method pushAllState

src/GraphCtrl/GraphElement/GElementRepository.cpp:62–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60
61
62CStatus GElementRepository::pushAllState(const GElementState& state) {
63 CGRAPH_FUNCTION_BEGIN
64 if (cur_state_ == state) {
65 return status; // 避免重复赋值
66 }
67
68 for (auto& cur : elements_) {
69 cur->cur_state_.store(state, std::memory_order_release);
70 if (GElementState::SUSPEND != state) {
71 // 目前仅非 suspend 状态,需要切换的。如果一直处于 suspend 状态,是不需要被通知的
72 cur->suspend_locker_.cv_.notify_one();
73 }
74 }
75 cur_state_ = state; // 记录当前的状态信息
76 CGRAPH_FUNCTION_END
77}
78
79
80CVoid GElementRepository::fetchAll(GElementManagerCPtr em) {

Callers 3

cancelMethod · 0.80
suspendMethod · 0.80
resumeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected