int run_main (int , ACE_TCHAR *[]) { ACE_START_TEST (ACE_TEXT ("Bug_4055_Regression_Test")); # if defined (ACE_HAS_THREADS) int status = 1; ACE_Thread_Mutex mutex_; ACE_Condition_Thread_Mutex condition_ (mutex_); ACE_Condition_Attributes_T<ACE_Monotonic_Time_Policy> monotonic_cond_attr_; ACE_Condition_Thread_Mutex monotonic_condition_ (mutex_, monotonic_cond_attr_); if (mutex_.acquire () != 0) { ACE_ERROR ((LM_ERROR, "(%P|%t) ERROR: Failed to acquire mutex.\n")); } else { ACE_Time_Value waittime; waittime = waittime.now (); if (test_timer (condition_, waittime)) { ACE_Time_Value_T<ACE_Monotonic_Time_Policy> monotonic_waittime; monotonic_waittime = monotonic_waittime.now (); if (test_timer (monotonic_condition_, monotonic_waittime, true)) status = 0; } } # else int status = 0; # endif ACE_END_TEST; return status; }
bool perform() { if (condition_(this->ec_, this->bytes_transfered_, this->buffer_.read_head() + data_head_, last_check_)) { return true; } if (this->buffer_.write_size() == 0) { return false; } while (true) { if (!BaseType::perform()) break; if (this->ec_ || condition_(this->ec_, this->bytes_transfered_, this->buffer_.read_head() + data_head_, last_check_)) { return true; } last_check_ = this->bytes_transfered_; } // printf("false until: ec %d bt %lu\n", this->ec_, this->bytes_transfered_); return false; }