summaryrefslogtreecommitdiff
path: root/ACE/ace/TP_Reactor.cpp
diff options
context:
space:
mode:
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 ac9bbdada63..16eb60972dc 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__)
@@ -307,40 +308,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