TAO_Dynamic_Thread_Pool_Threads Class Reference

Class representing a dynamic thread running in a thread lane. More...

#include <Thread_Pool.h>

Inheritance diagram for TAO_Dynamic_Thread_Pool_Threads:

Inheritance graph
[legend]
Collaboration diagram for TAO_Dynamic_Thread_Pool_Threads:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TAO_Dynamic_Thread_Pool_Threads (TAO_Thread_Lane &lane)
 Constructor.


Protected Member Functions

virtual int run (TAO_ORB_Core &orb_core)
 Do the real work.


Detailed Description

Class representing a dynamic thread running in a thread lane.

Definition at line 104 of file Thread_Pool.h.


Constructor & Destructor Documentation

TAO_Dynamic_Thread_Pool_Threads::TAO_Dynamic_Thread_Pool_Threads TAO_Thread_Lane lane  ) 
 

Constructor.

Definition at line 98 of file Thread_Pool.cpp.

00099   : TAO_Thread_Pool_Threads (lane)
00100 {
00101 }


Member Function Documentation

int TAO_Dynamic_Thread_Pool_Threads::run TAO_ORB_Core orb_core  )  [protected, virtual]
 

Do the real work.

Reimplemented from TAO_Thread_Pool_Threads.

Definition at line 104 of file Thread_Pool.cpp.

References ACE_DEBUG, ACE_TEXT, TAO_Thread_Lane::dynamic_thread_idle_timeout(), TAO_ORB_Core::has_shutdown(), TAO_Thread_Lane::id(), LM_DEBUG, TAO_ORB_Core::orb(), TAO_debug_level, and ACE_Task_Base::thr_count().

00105 {
00106   CORBA::ORB_ptr orb = orb_core.orb ();
00107 
00108   if (this->lane_.dynamic_thread_idle_timeout () == ACE_Time_Value::zero)
00109     {
00110       // No timeout specified, run the ORB until it shutdowns
00111       orb->run ();
00112     }
00113   else
00114     {
00115       // A timeout is specified, run the ORB in an idle loop, if we
00116       // don't handle any operations for the given timeout we just
00117       // exit the loop and this thread ends itself.
00118       ACE_Time_Value tv (this->lane_.dynamic_thread_idle_timeout ());
00119       while (!orb_core.has_shutdown () && orb->work_pending (tv))
00120         {
00121           orb->perform_work ();
00122           tv = this->lane_.dynamic_thread_idle_timeout ();
00123         }
00124 
00125       if (TAO_debug_level > 7)
00126         ACE_DEBUG ((LM_DEBUG,
00127                     ACE_TEXT ("TAO Process %P Pool %d Lane %d Thread %t\n")
00128                     ACE_TEXT ("Current number of dynamic threads left = %d; ")
00129                     ACE_TEXT ("RTCorba worker thread is ending!\n"),
00130                     this->lane_.pool ().id (),
00131                     this->lane_.id (),
00132                     this->thr_count () - 1));
00133     }
00134 
00135   return 0;
00136 }


The documentation for this class was generated from the following files:
Generated on Sun Jan 27 13:34:19 2008 for TAO_RTCORBA by doxygen 1.3.6