summaryrefslogtreecommitdiff
path: root/ace/Timer_Queue_T.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ace/Timer_Queue_T.cpp')
-rw-r--r--ace/Timer_Queue_T.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/ace/Timer_Queue_T.cpp b/ace/Timer_Queue_T.cpp
index 2327c64b532..7ced61d9f87 100644
--- a/ace/Timer_Queue_T.cpp
+++ b/ace/Timer_Queue_T.cpp
@@ -304,9 +304,16 @@ ACE_Event_Handler_Handle_Timeout_Upcall<ACE_LOCK>::timeout (TIMER_QUEUE &timer_q
const void *act,
const ACE_Time_Value &cur_time)
{
- // Upcall to the <handler>s handle_timeout method.
+ // Upcall to the <handler>s handle_timeout() method.
if (handler->handle_timeout (cur_time, act) == -1)
- timer_queue.cancel (handler, 0); // 0 means "call handle_close()".
+ {
+ if (handler->reactor ())
+ // Call the reactor's cancel_timer() method to minimize locking.
+ handler->reactor ()->cancel_timer (handler, 0); // 0 means "call handle_close()".
+ else
+ // Upcall to the handler's handle_timeout method.
+ timer_queue.cancel (handler, 0);
+ }
return 0;
}