summaryrefslogtreecommitdiff
path: root/ACE/ace/TP_Reactor.cpp
diff options
context:
space:
mode:
authormcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2011-12-15 11:09:41 +0000
committermcorino <mcorino@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2011-12-15 11:09:41 +0000
commit9d1004206324867a4287e99b9675d24e536fa090 (patch)
tree89d59383f294627917ee3cf054f347884a914f32 /ACE/ace/TP_Reactor.cpp
parentb8d69007a4e25977f11cc3de8eb3793c0c61161a (diff)
downloadATCD-9d1004206324867a4287e99b9675d24e536fa090.tar.gz
Thu Dec 15 11:00:00 UTC 2011 Martin Corino <mcorino@remedy.nl>
Merged timer_policy branch.
Diffstat (limited to 'ACE/ace/TP_Reactor.cpp')
-rw-r--r--ACE/ace/TP_Reactor.cpp37
1 files changed, 4 insertions, 33 deletions
diff --git a/ACE/ace/TP_Reactor.cpp b/ACE/ace/TP_Reactor.cpp
index bd0a7c12884..2c7c4d0b13e 100644
--- a/ACE/ace/TP_Reactor.cpp
+++ b/ACE/ace/TP_Reactor.cpp
@@ -5,6 +5,7 @@
#include "ace/Timer_Queue.h"
#include "ace/Sig_Handler.h"
#include "ace/Log_Msg.h"
+#include "ace/Functor_T.h"
#include "ace/OS_NS_sys_time.h"
#if !defined (__ACE_INLINE__)
@@ -306,40 +307,10 @@ int
ACE_TP_Reactor::handle_timer_events (int & /*event_count*/,
ACE_TP_Token_Guard &guard)
{
- if (this->timer_queue_ == 0 || this->timer_queue_->is_empty())
- { // Empty timer queue so cannot have any expired timers.
- return 0;
- }
-
- // Get the current time
- ACE_Time_Value cur_time (this->timer_queue_->gettimeofday () +
- this->timer_queue_->timer_skew ());
-
- // Look for a node in the timer queue whose timer <= the present
- // time.
- ACE_Timer_Node_Dispatch_Info 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);
+ typedef ACE_Member_Function_Command<ACE_TP_Token_Guard> Guard_Release;
- // Release the token before dispatching notifies...
- guard.release_token ();
-
- // call the functor
- this->timer_queue_->upcall (info, cur_time);
-
- // Postinvoke
- this->timer_queue_->postinvoke (info, cur_time, upcall_act);
-
- // We have dispatched a timer
- return 1;
- }
-
- return 0;
+ Guard_Release release(guard, &ACE_TP_Token_Guard::release_token);
+ return this->timer_queue_->expire_single(release);
}
int