Class representing a dynamic thread running in a thread lane. More...
#include <Thread_Pool.h>
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. |
Class representing a dynamic thread running in a thread lane.
Definition at line 105 of file Thread_Pool.h.
TAO_Dynamic_Thread_Pool_Threads::TAO_Dynamic_Thread_Pool_Threads | ( | TAO_Thread_Lane & | lane | ) |
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 107 of file Thread_Pool.cpp.
{ CORBA::ORB_ptr orb = orb_core.orb (); switch (this->lane_.lifespan ()) { case TAO_RT_ORBInitializer::TAO_RTCORBA_DT_FIXED : { ACE_Time_Value tv_run (this->lane_.dynamic_thread_time ()); orb->run (tv_run); } break; case TAO_RT_ORBInitializer::TAO_RTCORBA_DT_IDLE : { // A timeout is specified, run the ORB in an idle loop, if we // don't handle any operations for the given timeout we just // exit the loop and this thread ends itself. ACE_Time_Value tv (this->lane_.dynamic_thread_time ()); while (!orb_core.has_shutdown () && orb->work_pending (tv)) { // Run the ORB for the specified timeout, this prevents looping // between work_pending/handle_events tv = this->lane_.dynamic_thread_time (); orb->run (tv); // Reset the idle timeout tv = this->lane_.dynamic_thread_time (); } } break; case TAO_RT_ORBInitializer::TAO_RTCORBA_DT_INFINITIVE : { // No timeout specified, run the ORB until it shutdowns orb->run (); } break; } if (TAO_debug_level > 7) { ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("TAO Process %P Pool %d Lane %d Thread %t\n") ACE_TEXT ("Current number of dynamic threads left = %d; ") ACE_TEXT ("RTCorba worker thread is ending!\n"), this->lane_.pool ().id (), this->lane_.id (), this->thr_count () - 1)); } return 0; }