diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-12-15 15:01:23 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2007-12-15 15:01:23 +0000 |
commit | 2c949803f4ebcfb3771b7e560cbebdecbb70e074 (patch) | |
tree | d992f733c4865f739e10b150a7fa5c6f28969412 /ACE/ace/TP_Reactor.cpp | |
parent | a2f3cd42eaeaa4f7ab870372a28a04f70a246c1c (diff) | |
download | ATCD-2c949803f4ebcfb3771b7e560cbebdecbb70e074.tar.gz |
Sat Dec 15 14:57:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl>
Diffstat (limited to 'ACE/ace/TP_Reactor.cpp')
-rw-r--r-- | ACE/ace/TP_Reactor.cpp | 43 |
1 files changed, 14 insertions, 29 deletions
diff --git a/ACE/ace/TP_Reactor.cpp b/ACE/ace/TP_Reactor.cpp index 37c114703a9..4216fa3db15 100644 --- a/ACE/ace/TP_Reactor.cpp +++ b/ACE/ace/TP_Reactor.cpp @@ -170,20 +170,18 @@ ACE_TP_Reactor::handle_events (ACE_Time_Value *max_wait_time) // Update the countdown to reflect time waiting for the token. countdown.update (); - return this->dispatch_i (max_wait_time, - guard); + return this->dispatch_i (max_wait_time, guard); } int ACE_TP_Reactor::dispatch_i (ACE_Time_Value *max_wait_time, ACE_TP_Token_Guard &guard) { - int event_count = - this->get_event_for_dispatching (max_wait_time); + int event_count = this->get_event_for_dispatching (max_wait_time); // We use this count to detect potential infinite loops as described // in bug 2540. - int initial_event_count = event_count; + int const initial_event_count = event_count; int result = 0; @@ -205,8 +203,7 @@ ACE_TP_Reactor::dispatch_i (ACE_Time_Value *max_wait_time, // now is not the right thing... // // @@ We need to do better.. - return this->handle_signals (event_count, - guard); + return this->handle_signals (event_count, guard); } #endif // #if 0 @@ -221,8 +218,7 @@ ACE_TP_Reactor::dispatch_i (ACE_Time_Value *max_wait_time, // need to do that. In the future we *may* have the timers also // returned through the <event_count>. Just passing that along for // that day. - result = this->handle_timer_events (event_count, - guard); + result = this->handle_timer_events (event_count, guard); if (result > 0) return result; @@ -234,8 +230,7 @@ ACE_TP_Reactor::dispatch_i (ACE_Time_Value *max_wait_time, // Next dispatch the notification handlers (if there are any to // dispatch). These are required to handle multiple-threads // that are trying to update the <Reactor>. - result = this->handle_notify_events (event_count, - guard); + result = this->handle_notify_events (event_count, guard); if (result > 0) return result; @@ -249,8 +244,7 @@ ACE_TP_Reactor::dispatch_i (ACE_Time_Value *max_wait_time, result = this->handle_socket_events (event_count, guard); } - if (event_count != 0 - && event_count == initial_event_count) + if (event_count != 0 && event_count == initial_event_count) { this->state_changed_ = true; } @@ -326,27 +320,21 @@ ACE_TP_Reactor::handle_timer_events (int & /*event_count*/, // time. ACE_Timer_Node_Dispatch_Info info; - if (this->timer_queue_->dispatch_info (cur_time, - info)) + if (this->timer_queue_->dispatch_info (cur_time, info)) { const void *upcall_act = 0; // Preinvoke. - this->timer_queue_->preinvoke (info, - cur_time, - upcall_act); + this->timer_queue_->preinvoke (info, cur_time, upcall_act); // Release the token before dispatching notifies... guard.release_token (); // call the functor - this->timer_queue_->upcall (info, - cur_time); + this->timer_queue_->upcall (info, cur_time); // Postinvoke - this->timer_queue_->postinvoke (info, - cur_time, - upcall_act); + this->timer_queue_->postinvoke (info, cur_time, upcall_act); // We have dispatched a timer return 1; @@ -360,8 +348,7 @@ ACE_TP_Reactor::handle_notify_events (int & /*event_count*/, ACE_TP_Token_Guard &guard) { // Get the handle on which notify calls could have occured - ACE_HANDLE notify_handle = - this->get_notify_handle (); + ACE_HANDLE notify_handle = this->get_notify_handle (); int result = 0; @@ -378,8 +365,7 @@ ACE_TP_Reactor::handle_notify_events (int & /*event_count*/, // Keep reading notifies till we empty it or till we have a // dispatchable buffer - while (this->notify_handler_->read_notify_pipe (notify_handle, - buffer) > 0) + while (this->notify_handler_->read_notify_pipe (notify_handle, buffer) > 0) { // Just figure out whether we can read any buffer that has // dispatchable info. If not we have just been unblocked by @@ -487,8 +473,7 @@ ACE_TP_Reactor::get_event_for_dispatching (ACE_Time_Value *max_wait_time) this->ready_set_.ex_mask_.sync (this->ready_set_.ex_mask_.max_set ()); } - return this->wait_for_multiple_events (this->ready_set_, - max_wait_time); + return this->wait_for_multiple_events (this->ready_set_, max_wait_time); } int |