From 35e40e117fd23ad3777232f65a4df37628565b91 Mon Sep 17 00:00:00 2001 From: brunsch Date: Thu, 24 Jul 1997 16:39:59 +0000 Subject: Fixed free list corruption with reschedule --- ace/Timer_Heap_T.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ace/Timer_Heap_T.cpp') diff --git a/ace/Timer_Heap_T.cpp b/ace/Timer_Heap_T.cpp index 48708f8875a..c2087075f4f 100644 --- a/ace/Timer_Heap_T.cpp +++ b/ace/Timer_Heap_T.cpp @@ -448,6 +448,15 @@ ACE_Timer_Heap_T::reschedule (ACE_Timer_Node_T *expir { ACE_TRACE ("ACE_Timer_Heap::reschedule"); + // From James Crawford + // If we are rescheduling then we have freed our timer id so we need + // to reacquire it. + // NOTE: we rely on the fact that we will get the same timer id we just + // freed. + int timerId = this->timer_id (); + + ACE_ASSERT(timerId == expired->get_timer_id ()); // Just to be safe... + // Restore the heap property. this->insert (expired); } -- cgit v1.2.1