blob: 2885a6c62ff4d2754f4c3ffb18e08096fff4a6fc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#include "Hello.h"
#include "ace/OS_NS_unistd.h"
Hello::Hello(
CORBA::ORB_ptr orb,
bool simulate_crashes)
: orb_ (CORBA::ORB::_duplicate (orb))
, simulate_crashes_(simulate_crashes)
, atomic_counter_(200)
{
}
void
Hello::short_sleep (void)
{
long count = atomic_counter_--;
#if 0
if(count % 40 == 0)
{
ACE_DEBUG((LM_DEBUG, "(%P|%t) Counter was %d\n", count));
}
#endif /* 0 */
if(simulate_crashes_ && count == 0)
{
ACE_DEBUG((LM_DEBUG, "Aborting!\n"));
ACE_Time_Value tv(5, 0);
ACE_OS::sleep(tv);
ACE_OS::abort();
}
}
|