summaryrefslogtreecommitdiff
path: root/trunk/TAO/tests/Bug_1551_Regression/Hello.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'trunk/TAO/tests/Bug_1551_Regression/Hello.cpp')
-rw-r--r--trunk/TAO/tests/Bug_1551_Regression/Hello.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/trunk/TAO/tests/Bug_1551_Regression/Hello.cpp b/trunk/TAO/tests/Bug_1551_Regression/Hello.cpp
new file mode 100644
index 00000000000..5c72639015f
--- /dev/null
+++ b/trunk/TAO/tests/Bug_1551_Regression/Hello.cpp
@@ -0,0 +1,36 @@
+// $Id$
+
+#include "Hello.h"
+#include "ace/OS_NS_unistd.h"
+
+ACE_RCSID(Bug_1XXX_Regression, Hello, "$Id$")
+
+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 (ACE_ENV_SINGLE_ARG_DECL_NOT_USED)
+ ACE_THROW_SPEC ((CORBA::SystemException))
+{
+ 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();
+ }
+}