summaryrefslogtreecommitdiff
path: root/ace/Timer_Heap_T.cpp
diff options
context:
space:
mode:
authorbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-07-24 16:39:59 +0000
committerbrunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-07-24 16:39:59 +0000
commitc58bdacf9900f0a0b43b16d9f8e8539232a3ef95 (patch)
tree0e74b258c064e867630b1f3a92cc21ac5583209e /ace/Timer_Heap_T.cpp
parent6700ca0c8dcb6ce3dce466be958a9895587803fb (diff)
downloadATCD-c58bdacf9900f0a0b43b16d9f8e8539232a3ef95.tar.gz
Fixed free list corruption with reschedule
Diffstat (limited to 'ace/Timer_Heap_T.cpp')
-rw-r--r--ace/Timer_Heap_T.cpp9
1 files changed, 9 insertions, 0 deletions
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<TYPE, FUNCTOR, LOCK>::reschedule (ACE_Timer_Node_T<TYPE> *expir
{
ACE_TRACE ("ACE_Timer_Heap::reschedule");
+ // From James Crawford <jamesc@in.ot.com.au>
+ // 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);
}