summaryrefslogtreecommitdiff
path: root/tests/Reactor_Timer_Test.cpp
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1998-08-26 02:09:26 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1998-08-26 02:09:26 +0000
commitb6eec258977a2076fbc5e62a5d712f4494eea4ff (patch)
tree4e49d4a48de66970ab7463398539927c9cf07937 /tests/Reactor_Timer_Test.cpp
parent0dc502f2c1944bb52e0d05e9ac897991cbef0d2d (diff)
downloadATCD-b6eec258977a2076fbc5e62a5d712f4494eea4ff.tar.gz
*** empty log message ***
Diffstat (limited to 'tests/Reactor_Timer_Test.cpp')
-rw-r--r--tests/Reactor_Timer_Test.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/Reactor_Timer_Test.cpp b/tests/Reactor_Timer_Test.cpp
index a5f0d6f6baa..0358d973164 100644
--- a/tests/Reactor_Timer_Test.cpp
+++ b/tests/Reactor_Timer_Test.cpp
@@ -43,14 +43,15 @@ public:
long current_count = long (arg);
ACE_ASSERT (current_count == count);
- ACE_DEBUG ((LM_DEBUG, ASYS_TEXT ("%d: Timer #%d timed out at %d!\n"),
- count, current_count, tv.sec ()));
-
+ ACE_DEBUG ((LM_DEBUG,
+ ASYS_TEXT ("%d: Timer #%d timed out at %d!\n"),
+ count,
+ current_count,
+ tv.sec ()));
count += (1 + odd);
- if (long(current_count) == long(ACE_MAX_TIMERS - 1))
+ if (long (current_count) == long (ACE_MAX_TIMERS - 1))
done = 1;
-
return 0;
}
};
@@ -60,9 +61,12 @@ main (int, ASYS_TCHAR *[])
{
ACE_START_TEST (ASYS_TEXT ("Reactor_Timer_Test"));
+ // We put the <Time_Handler> first so that it'll still be alive when
+ // the <reactor> is closed down.
+ Time_Handler rt[ACE_MAX_TIMERS];
+
ACE_Reactor reactor;
- Time_Handler rt[ACE_MAX_TIMERS];
int t_id[ACE_MAX_TIMERS];
size_t i;
@@ -71,7 +75,6 @@ main (int, ASYS_TCHAR *[])
t_id[i] = reactor.schedule_timer (&rt[i],
(const void *) i,
ACE_Time_Value (2 * i + 1));
-
while (!done)
reactor.handle_events ();
@@ -84,7 +87,6 @@ main (int, ASYS_TCHAR *[])
t_id[i] = reactor.schedule_timer (&rt[0],
(const void *) i,
ACE_Time_Value (2 * i + 1));
-
while (!done)
reactor.handle_events ();