@@ -40,9 +40,9 @@ CStatus GSome::addElementEx(GElementPtr element) {
4040CStatus GSome::run () {
4141 CGRAPH_FUNCTION_BEGIN
4242
43- wait_num_ = getWaitNum ();
44- CGRAPH_RETURN_ERROR_STATUS_BY_CONDITION (wait_num_ > children_.size (),
45- " num is bigger than elements size." );
43+ threshold_ = getThreshold ();
44+ CGRAPH_RETURN_ERROR_STATUS_BY_CONDITION (threshold_ > children_.size (),
45+ " threshold cannot bigger than elements size." );
4646 cur_status_.reset ();
4747
4848 /* *
@@ -57,7 +57,7 @@ CStatus GSome::run() {
5757 const auto & curStatus = element->fatProcessor (CFunctionType::RUN );
5858 CGRAPH_UNIQUE_LOCK lock (lock_);
5959 cur_status_ += curStatus;
60- if (--wait_num_ == 0 || cur_status_.isErr ()) {
60+ if (--threshold_ == 0 || cur_status_.isErr ()) {
6161 cv_.notify_one ();
6262 }
6363 }
@@ -67,7 +67,7 @@ CStatus GSome::run() {
6767 thread_pool_->wakeupAllThread ();
6868 CGRAPH_UNIQUE_LOCK lock (lock_);
6969 cv_.wait (lock, [this ] {
70- return wait_num_ == 0 || cur_status_.isErr ();
70+ return threshold_ == 0 || cur_status_.isErr ();
7171 });
7272
7373 for (auto * element : children_) {
@@ -108,7 +108,7 @@ CStatus GSome::checkSuitable() {
108108 status = GElement::checkSuitable ();
109109 CGRAPH_FUNCTION_CHECK_STATUS
110110
111- CGRAPH_RETURN_ERROR_STATUS_BY_CONDITION (( CGRAPH_DEFAULT_LOOP_TIMES != loop_) , " GSome cannot set loop > 1." )
111+ CGRAPH_RETURN_ERROR_STATUS_BY_CONDITION (CGRAPH_DEFAULT_LOOP_TIMES != loop_, " GSome cannot set loop > 1." )
112112 CGRAPH_RETURN_ERROR_STATUS_BY_CONDITION (std::any_of (children_.begin (), children_.end (), [](GElementPtr ptr) {
113113 return !ptr->isAsync ();
114114 }), " GSome contains async node only." )
0 commit comments