diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2002-05-02 21:49:11 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2002-05-02 21:49:11 +0000 |
commit | c88db79f5252fa56f0dd4e8d6cc8c033a0d52b07 (patch) | |
tree | d44c9202300118c49698e84dbfd1abe1bb40ed52 | |
parent | f47c39bc28135adeb18dc988fbaa775028ba91ea (diff) | |
download | ATCD-c88db79f5252fa56f0dd4e8d6cc8c033a0d52b07.tar.gz |
ChangeLogTag:Thu May 2 14:02:20 2002 Ossama Othman <ossama@uci.edu>
-rw-r--r-- | ace/Dev_Poll_Reactor.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/ace/Dev_Poll_Reactor.cpp b/ace/Dev_Poll_Reactor.cpp index fc7a70948d1..09d51f9ae7b 100644 --- a/ace/Dev_Poll_Reactor.cpp +++ b/ace/Dev_Poll_Reactor.cpp @@ -1088,11 +1088,11 @@ ACE_Dev_Poll_Reactor::work_pending (const ACE_Time_Value & max_wait_time) // Update the countdown to reflect time waiting for the mutex. ACE_MT (countdown.update ()); - return this->work_pending_i (mwt); + return this->work_pending_i (&mwt); } int -ACE_Dev_Poll_Reactor::work_pending_i (ACE_Time_Value & max_wait_time) +ACE_Dev_Poll_Reactor::work_pending_i (ACE_Time_Value * max_wait_time) { ACE_TRACE ("ACE_Dev_Poll_Reactor::work_pending_i"); @@ -1106,7 +1106,7 @@ ACE_Dev_Poll_Reactor::work_pending_i (ACE_Time_Value & max_wait_time) ACE_Time_Value timer_buf (0); ACE_Time_Value *this_timeout = 0; - this_timeout = this->timer_queue_->calculate_timeout (&max_wait_time, + this_timeout = this->timer_queue_->calculate_timeout (max_wait_time, &timer_buf); // If "this_timeout" != 0, the poll must timeout to allow timers @@ -1156,9 +1156,15 @@ ACE_Dev_Poll_Reactor::work_pending_i (ACE_Time_Value & max_wait_time) if (nfds > -1) this->end_pfds_ = this->start_pfds_ + nfds; - // "nfds > 0" means that we have IO events to dispatch. - // "this_timeout != 0" means that we have timers to fire. - return (nfds > 0 || this_timeout != 0 ? 1 : nfds); + // Check if we have timers to fire. + int timers_pending = + ((this_timeout != 0 && max_wait_time == 0) + || (this_timeout != 0 && max_wait_time != 0 + && *this_timeout != *max_wait_time) ? 1 : 0); + + // If timers are pending, override any error condition from the + // poll. + return (nfds <= 0 && timers_pending != 0 ? 1 : nfds); } @@ -1199,7 +1205,7 @@ ACE_Dev_Poll_Reactor::handle_events_i (ACE_Time_Value *max_wait_time) // be restarted if so desired. do { - result = this->work_pending_i (*max_wait_time); + result = this->work_pending_i (max_wait_time); } while (result == -1 && this->restart_ != 0 && errno == EINTR); |