#include <Thread_Pool.h>
Inheritance diagram for TAO_Thread_Pool_Threads:
Public Member Functions | |
TAO_Thread_Pool_Threads (TAO_Thread_Lane &lane) | |
Constructor. | |
int | svc (void) |
Method executed when a thread is spawned. | |
TAO_Thread_Lane & | lane (void) const |
Accessor to the lane to which this thread belongs to. | |
Static Public Member Functions | |
static void | set_tss_resources (TAO_ORB_Core &orb_core, TAO_Thread_Lane &thread_lane) |
Set TSS resources for the current thread. | |
Protected Member Functions | |
virtual int | run (TAO_ORB_Core &orb_core) |
Do the real work. | |
Protected Attributes | |
TAO_Thread_Lane & | lane_ |
Lane to which this thread belongs to. |
Definition at line 72 of file Thread_Pool.h.
TAO_Thread_Pool_Threads::TAO_Thread_Pool_Threads | ( | TAO_Thread_Lane & | lane | ) |
Constructor.
Definition at line 40 of file Thread_Pool.cpp.
00041 : ACE_Task_Base (lane.pool ().manager ().orb_core ().thr_mgr ()), 00042 lane_ (lane) 00043 { 00044 }
TAO_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE TAO_Thread_Lane & TAO_Thread_Pool_Threads::lane | ( | void | ) | const |
Accessor to the lane to which this thread belongs to.
Definition at line 9 of file Thread_Pool.inl.
References lane_.
Referenced by svc().
00010 { 00011 return this->lane_; 00012 }
int TAO_Thread_Pool_Threads::run | ( | TAO_ORB_Core & | orb_core | ) | [protected, virtual] |
Do the real work.
Reimplemented in TAO_Dynamic_Thread_Pool_Threads.
Definition at line 76 of file Thread_Pool.cpp.
References TAO_ORB_Core::orb(), and CORBA::ORB::run().
Referenced by svc().
00077 { 00078 CORBA::ORB_ptr orb = orb_core.orb (); 00079 00080 // Run the ORB. 00081 orb->run (); 00082 00083 return 0; 00084 }
void TAO_Thread_Pool_Threads::set_tss_resources | ( | TAO_ORB_Core & | orb_core, | |
TAO_Thread_Lane & | thread_lane | |||
) | [static] |
Set TSS resources for the current thread.
Get the ORB_Core's TSS resources.
Set the lane attribute in TSS.
Definition at line 87 of file Thread_Pool.cpp.
References TAO_ORB_Core::get_tss_resources(), and TAO_ORB_Core_TSS_Resources::lane_.
Referenced by svc().
00089 { 00090 /// Get the ORB_Core's TSS resources. 00091 TAO_ORB_Core_TSS_Resources &tss = 00092 *orb_core.get_tss_resources (); 00093 00094 /// Set the lane attribute in TSS. 00095 tss.lane_ = &thread_lane; 00096 }
int TAO_Thread_Pool_Threads::svc | ( | void | ) | [virtual] |
Method executed when a thread is spawned.
Reimplemented from ACE_Task_Base.
Definition at line 47 of file Thread_Pool.cpp.
References ACE_ERROR, TAO_ORB_Core::has_shutdown(), lane(), LM_ERROR, TAO_Thread_Pool::manager(), TAO_Thread_Pool_Manager::orb_core(), TAO_Thread_Lane::pool(), run(), and set_tss_resources().
00048 { 00049 TAO_ORB_Core &orb_core = 00050 this->lane ().pool ().manager ().orb_core (); 00051 00052 if (orb_core.has_shutdown ()) 00053 return 0; 00054 00055 // Set TSS resources for this thread. 00056 TAO_Thread_Pool_Threads::set_tss_resources (orb_core, this->lane_); 00057 00058 try 00059 { 00060 // Do the work 00061 this->run (orb_core); 00062 } 00063 catch (const ::CORBA::Exception& ex) 00064 { 00065 // No point propagating this exception. Print it out. 00066 ACE_ERROR ((LM_ERROR, 00067 "orb->run() raised exception for thread %t\n")); 00068 00069 ex._tao_print_exception (""); 00070 } 00071 00072 return 0; 00073 }
TAO_Thread_Lane& TAO_Thread_Pool_Threads::lane_ [protected] |
Lane to which this thread belongs to.
Definition at line 94 of file Thread_Pool.h.
Referenced by lane(), and TAO_Dynamic_Thread_Pool_Threads::run().