#include <Base_Thread_Adapter.h>
Inheritance diagram for ACE_Base_Thread_Adapter:
Public Member Functions | |
virtual | ~ACE_Base_Thread_Adapter (void) |
virtual ACE_THR_FUNC_RETURN | invoke (void)=0 |
Virtual method invoked by the thread entry point. | |
ACE_THR_C_FUNC | entry_point (void) |
Static Public Member Functions | |
void | close_log_msg (void) |
Invoke the close_log_msg_hook, if it is present. | |
void | sync_log_msg (const ACE_TCHAR *prog_name) |
Invoke the sync_log_msg_hook, if it is present. | |
ACE_OS_Thread_Descriptor * | thr_desc_log_msg (void) |
Invoke the thr_desc_log_msg_hook, if it is present. | |
Protected Member Functions | |
ACE_Base_Thread_Adapter (ACE_THR_FUNC user_func, void *arg, ACE_THR_C_FUNC entry_point=(ACE_THR_C_FUNC) ACE_THREAD_ADAPTER_NAME, ACE_OS_Thread_Descriptor *td=0) | |
Constructor. | |
void | inherit_log_msg (void) |
Protected Attributes | |
ACE_THR_FUNC | user_func_ |
Thread startup function passed in by the user (C++ linkage). | |
void * | arg_ |
Argument to thread startup function. | |
ACE_THR_C_FUNC | entry_point_ |
ACE_OS_Thread_Descriptor * | thr_desc_ |
ACE_OS_Log_Msg_Attributes | log_msg_attributes_ |
The ACE_Log_Msg attributes. | |
Static Private Member Functions | |
void | set_log_msg_hooks (ACE_INIT_LOG_MSG_HOOK init_hook, ACE_INHERIT_LOG_MSG_HOOK inherit_hook, ACE_CLOSE_LOG_MSG_HOOK close_hook, ACE_SYNC_LOG_MSG_HOOK sync_hook, ACE_THR_DESC_LOG_MSG_HOOK thr_desc) |
Set the Log_Msg hooks. | |
Static Private Attributes | |
ACE_INIT_LOG_MSG_HOOK | init_log_msg_hook_ = 0 |
The hooks to inherit and cleanup the Log_Msg attributes. | |
ACE_INHERIT_LOG_MSG_HOOK | inherit_log_msg_hook_ = 0 |
ACE_CLOSE_LOG_MSG_HOOK | close_log_msg_hook_ = 0 |
ACE_SYNC_LOG_MSG_HOOK | sync_log_msg_hook_ = 0 |
ACE_THR_DESC_LOG_MSG_HOOK | thr_desc_log_msg_hook_ = 0 |
Friends | |
class | ACE_Log_Msg |
Allow the ACE_Log_Msg class to set its hooks. |
Converts a C++ function into a function that can be called from a thread creation routine (e.g., pthread_create() or _beginthreadex()) that expects an extern "C" entry point. This class also makes it possible to transparently provide hooks to register a thread with an ACE_Thread_Manager. This class is used in ACE_OS::thr_create(). In general, the thread that creates an object of this class is different from the thread that calls invoke()
on this object. Therefore, the invoke()
method is responsible for deleting itself.
Definition at line 86 of file Base_Thread_Adapter.h.
|
Definition at line 55 of file Base_Thread_Adapter.cpp.
00056 { 00057 } |
|
Constructor.
Definition at line 25 of file Base_Thread_Adapter.cpp. References ACE_OS_TRACE, init_log_msg_hook_, and log_msg_attributes_.
00035 : user_func_ (user_func) 00036 , arg_ (arg) 00037 , entry_point_ (entry_point) 00038 , thr_desc_ (td) 00039 { 00040 ACE_OS_TRACE ("ACE_Base_Thread_Adapter::ACE_Base_Thread_Adapter"); 00041 00042 if (ACE_Base_Thread_Adapter::init_log_msg_hook_ != 0) 00043 (*ACE_Base_Thread_Adapter::init_log_msg_hook_) ( 00044 this->log_msg_attributes_ 00045 # if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) 00046 , selector 00047 , handler 00048 # endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ 00049 ); 00050 #ifdef ACE_USES_GPROF 00051 getitimer (ITIMER_PROF, &itimer_); 00052 #endif // ACE_USES_GPROF 00053 } |
|
Invoke the close_log_msg_hook, if it is present.
Definition at line 69 of file Base_Thread_Adapter.cpp. References close_log_msg_hook_. Referenced by ACE_OS::cleanup_tss().
00070 { 00071 if (ACE_Base_Thread_Adapter::close_log_msg_hook_ != 0) 00072 (*ACE_Base_Thread_Adapter::close_log_msg_hook_) (); 00073 } |
|
Accessor for the C entry point function to the OS thread creation routine. Definition at line 35 of file Base_Thread_Adapter.inl. References entry_point_. Referenced by ACE_OS::thr_create().
00036 { 00037 return this->entry_point_; 00038 } |
|
Inherit the logging features if the parent thread has an ACE_Log_Msg. Definition at line 60 of file Base_Thread_Adapter.cpp. References inherit_log_msg_hook_, log_msg_attributes_, and thr_desc_. Referenced by ACE_Thread_Adapter::invoke(), and ACE_OS_Thread_Adapter::invoke().
00061 { 00062 if (ACE_Base_Thread_Adapter::inherit_log_msg_hook_ != 0) 00063 (*ACE_Base_Thread_Adapter::inherit_log_msg_hook_)( 00064 this->thr_desc_, 00065 this->log_msg_attributes_); 00066 } |
|
Virtual method invoked by the thread entry point.
Implemented in ACE_OS_Thread_Adapter, and ACE_Thread_Adapter. |
|
Set the Log_Msg hooks.
Definition at line 20 of file Base_Thread_Adapter.inl. References ACE_CLOSE_LOG_MSG_HOOK, ACE_INHERIT_LOG_MSG_HOOK, ACE_INIT_LOG_MSG_HOOK, ACE_SYNC_LOG_MSG_HOOK, ACE_THR_DESC_LOG_MSG_HOOK, close_log_msg_hook_, inherit_log_msg_hook_, init_log_msg_hook_, sync_log_msg_hook_, and thr_desc_log_msg_hook_. Referenced by ACE_Log_Msg::ACE_Log_Msg().
00026 { 00027 ACE_Base_Thread_Adapter::init_log_msg_hook_ = init_hook; 00028 ACE_Base_Thread_Adapter::inherit_log_msg_hook_ = inherit_hook; 00029 ACE_Base_Thread_Adapter::close_log_msg_hook_ = close_hook; 00030 ACE_Base_Thread_Adapter::sync_log_msg_hook_ = sync_hook; 00031 ACE_Base_Thread_Adapter::thr_desc_log_msg_hook_ = thr_desc_hook; 00032 } |
|
Invoke the sync_log_msg_hook, if it is present.
Definition at line 76 of file Base_Thread_Adapter.cpp. References ACE_TCHAR, and sync_log_msg_hook_. Referenced by ACE_OS::fork().
00077 { 00078 if (ACE_Base_Thread_Adapter::sync_log_msg_hook_ != 0) 00079 (*ACE_Base_Thread_Adapter::sync_log_msg_hook_) (prg); 00080 } |
|
Invoke the thr_desc_log_msg_hook, if it is present.
Definition at line 83 of file Base_Thread_Adapter.cpp. References thr_desc_log_msg_hook_. Referenced by ACE_OS::thr_exit().
00084 { 00085 if (ACE_Base_Thread_Adapter::thr_desc_log_msg_hook_ != 0) 00086 return (*ACE_Base_Thread_Adapter::thr_desc_log_msg_hook_) (); 00087 return 0; 00088 } |
|
Allow the ACE_Log_Msg class to set its hooks.
Definition at line 145 of file Base_Thread_Adapter.h. |
|
Argument to thread startup function.
Definition at line 152 of file Base_Thread_Adapter.h. |
|
Definition at line 21 of file Base_Thread_Adapter.cpp. Referenced by close_log_msg(), and set_log_msg_hooks(). |
|
Entry point to the underlying OS thread creation call (C linkage). Definition at line 156 of file Base_Thread_Adapter.h. Referenced by entry_point(). |
|
Definition at line 20 of file Base_Thread_Adapter.cpp. Referenced by inherit_log_msg(), and set_log_msg_hooks(). |
|
The hooks to inherit and cleanup the Log_Msg attributes.
Definition at line 19 of file Base_Thread_Adapter.cpp. Referenced by ACE_Base_Thread_Adapter(), and set_log_msg_hooks(). |
|
The ACE_Log_Msg attributes.
Definition at line 167 of file Base_Thread_Adapter.h. Referenced by ACE_Base_Thread_Adapter(), and inherit_log_msg(). |
|
Definition at line 22 of file Base_Thread_Adapter.cpp. Referenced by set_log_msg_hooks(), and sync_log_msg(). |
|
Optional thread descriptor. Passing this pointer in will force the spawned thread to cache this location in and wait until fills in all information in thread descriptor. Definition at line 164 of file Base_Thread_Adapter.h. Referenced by inherit_log_msg(). |
|
Definition at line 23 of file Base_Thread_Adapter.cpp. Referenced by set_log_msg_hooks(), and thr_desc_log_msg(). |
|
Thread startup function passed in by the user (C++ linkage).
Definition at line 149 of file Base_Thread_Adapter.h. |