summaryrefslogtreecommitdiff
path: root/TAO/tests/RTCORBA/Bug_3643_Regression/test_i.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'TAO/tests/RTCORBA/Bug_3643_Regression/test_i.cpp')
-rw-r--r--TAO/tests/RTCORBA/Bug_3643_Regression/test_i.cpp68
1 files changed, 68 insertions, 0 deletions
diff --git a/TAO/tests/RTCORBA/Bug_3643_Regression/test_i.cpp b/TAO/tests/RTCORBA/Bug_3643_Regression/test_i.cpp
new file mode 100644
index 00000000000..55d36ae90e3
--- /dev/null
+++ b/TAO/tests/RTCORBA/Bug_3643_Regression/test_i.cpp
@@ -0,0 +1,68 @@
+// $Id$
+
+#include "test_i.h"
+#include "ace/OS_NS_unistd.h"
+#include "tao/ORB_Core.h"
+#include "tao/RTCORBA/Thread_Pool.h"
+
+ACE_RCSID(Thread_Pools, test_i, "$Id$")
+
+test_i::test_i (CORBA::ORB_ptr orb,
+ PortableServer::POA_ptr poa,
+ long msec_sleep)
+ : orb_ (CORBA::ORB::_duplicate (orb)),
+ poa_ (PortableServer::POA::_duplicate (poa)),
+ nap_time_ ()
+{
+ this->nap_time_.msec (msec_sleep);
+}
+
+CORBA::Long
+test_i::method (CORBA::Long client_id,
+ CORBA::Long iteration,
+ CORBA::Long_out thread_count)
+{
+ // Get the ORB_Core's TSS resources.
+ TAO_ORB_Core_TSS_Resources *tss =
+ this->orb_->orb_core ()->get_tss_resources ();
+
+ /// Get the lane attribute in TSS.
+ TAO_Thread_Lane *lane =
+ static_cast <TAO_Thread_Lane *> (tss->lane_);
+
+#ifndef NDEBUG
+ if (lane)
+ ACE_DEBUG ((LM_DEBUG,
+ "Request in thread %t (pool id = %d; lane id = %d) for client %d iteration %d\n",
+ lane->pool ().id (),
+ lane->id (),
+ client_id,
+ iteration));
+ else
+ ACE_DEBUG ((LM_DEBUG,
+ "Request in thread %t (default thread pool) for client %d iteration %d\n",
+ client_id,
+ iteration));
+#endif // NDEBUG
+
+ ACE_OS::sleep (this->nap_time_);
+
+ if (lane)
+ thread_count = lane->current_threads ();
+ else
+ thread_count = 0;
+
+ return iteration;
+}
+
+PortableServer::POA_ptr
+test_i::_default_POA (void)
+{
+ return PortableServer::POA::_duplicate (this->poa_.in ());
+}
+
+void
+test_i::shutdown (void)
+{
+ this->orb_->shutdown (0);
+}