From 114b9575f85b78e54edbf04fcc4191d685877699 Mon Sep 17 00:00:00 2001 From: mcorino Date: Mon, 19 Dec 2011 13:38:49 +0000 Subject: Mon Dec 19 13:28:16 UTC 2011 Martin Corino * ace/Abstract_Timer_Queue.h: * ace/Timer_Hash_T.h: * ace/Timer_Hash_T.cpp: * ace/Timer_Heap_T.h: * ace/Timer_Heap_T.cpp: * ace/Timer_List_T.h: * ace/Timer_List_T.cpp: * ace/Timer_Queue_Adapters.inl: * ace/Timer_Queue_Adapters.cpp: * ace/Timer_Wheel_T.h: * ace/Timer_Wheel_T.cpp: Added close() method. * ace/Dev_Poll_Reactor.cpp: * ace/Proactor.cpp: * ace/Select_Reactor_T.cpp: * ace/WFMO_Reactor.cpp: Implemented support for timer queue close (). The rationale for these changes is that when using reactors with user defined timer queues the reactor does not delete the timer queue when being deleted itself. Without any other cleanup this created the possibility (as encountered in TAO/tests/Bug_3837_Regression after introduction of the TIME_POLICY changes) of outstanding timer handlers in the queue being triggered and attempting to access the reactor after the reactor has been destroyed. Calling close () for timer queues the reactor does not delete solves this potential problem. --- ACE/ace/Timer_Heap_T.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ACE/ace/Timer_Heap_T.h') diff --git a/ACE/ace/Timer_Heap_T.h b/ACE/ace/Timer_Heap_T.h index 5fd55f9b603..c3489b581a4 100644 --- a/ACE/ace/Timer_Heap_T.h +++ b/ACE/ace/Timer_Heap_T.h @@ -165,6 +165,11 @@ public: const void **act = 0, int dont_call_handle_close = 1); + /** + * Destroy timer queue. Cancels all timers. + */ + virtual int close (void); + /// Returns a pointer to this ACE_Timer_Queue's iterator. virtual ACE_Timer_Queue_Iterator_T &iter (void); -- cgit v1.2.1