Changes to attempt to silence bcc64x
[ACE_TAO.git] / ACE / ace / Event_Handler_Handle_Timeout_Upcall.cpp
blob597afd18897622f5e6f68384c75e4c5e46193ee2
1 #include "ace/Event_Handler_Handle_Timeout_Upcall.h"
2 #include "ace/Reactor_Timer_Interface.h"
3 #include "ace/Abstract_Timer_Queue.h"
5 #if !defined(__ACE_INLINE__)
6 # include "ace/Event_Handler_Handle_Timeout_Upcall.inl"
7 #endif /* __ACE_INLINE__ */
9 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
11 ACE_ALLOC_HOOK_DEFINE(ACE_Event_Handler_Handle_Timeout_Upcall)
13 int
14 ACE_Event_Handler_Handle_Timeout_Upcall::
15 timeout (ACE_Timer_Queue &timer_queue,
16 ACE_Event_Handler *event_handler,
17 const void *act,
18 int recurring_timer,
19 const ACE_Time_Value &cur_time)
21 int requires_reference_counting = 0;
23 if (!recurring_timer)
25 requires_reference_counting =
26 event_handler->reference_counting_policy ().value () ==
27 ACE_Event_Handler::Reference_Counting_Policy::ENABLED;
30 // Upcall to the <handler>s handle_timeout method.
31 if (event_handler->handle_timeout (cur_time, act) == -1)
33 if (event_handler->reactor_timer_interface ())
34 event_handler->reactor_timer_interface ()->cancel_timer (event_handler, 0);
35 else
36 timer_queue.cancel (event_handler, 0); // 0 means "call handle_close()".
39 if (!recurring_timer &&
40 requires_reference_counting)
42 event_handler->remove_reference ();
45 return 0;
48 int
49 ACE_Event_Handler_Handle_Timeout_Upcall::
50 cancel_type (ACE_Timer_Queue &,
51 ACE_Event_Handler *event_handler,
52 int dont_call,
53 int &requires_reference_counting)
55 requires_reference_counting =
56 event_handler->reference_counting_policy ().value () ==
57 ACE_Event_Handler::Reference_Counting_Policy::ENABLED;
59 // Upcall to the <handler>s handle_close method
60 if (dont_call == 0)
61 event_handler->handle_close (ACE_INVALID_HANDLE,
62 ACE_Event_Handler::TIMER_MASK);
64 return 0;
67 int
68 ACE_Event_Handler_Handle_Timeout_Upcall::
69 deletion (ACE_Timer_Queue &timer_queue,
70 ACE_Event_Handler *event_handler,
71 const void *)
73 int requires_reference_counting = 0;
75 this->cancel_type (timer_queue,
76 event_handler,
78 requires_reference_counting);
80 this->cancel_timer (timer_queue,
81 event_handler,
83 requires_reference_counting);
85 return 0;
88 ACE_END_VERSIONED_NAMESPACE_DECL