ACE 8.0.2
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
ACE_Thread_Adapter Class Reference

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. More...

#include <Thread_Adapter.h>

Inheritance diagram for ACE_Thread_Adapter:
Inheritance graph
[legend]
Collaboration diagram for ACE_Thread_Adapter:
Collaboration graph
[legend]

Public Member Functions

 ACE_Thread_Adapter (ACE_THR_FUNC user_func, void *arg, ACE_THR_C_FUNC entry_point=(ACE_THR_C_FUNC) ACE_THREAD_ADAPTER_NAME, ACE_Thread_Manager *thr_mgr=0, ACE_Thread_Descriptor *td=0, long cancel_flags=0)
 Constructor.
 
virtual ACE_THR_FUNC_RETURN invoke ()
 
ACE_Thread_Managerthr_mgr ()
 Accessor for the optional ACE_Thread_Manager.
 
- Public Member Functions inherited from ACE_Base_Thread_Adapter
virtual ~ACE_Base_Thread_Adapter ()=default
 
ACE_THR_C_FUNC entry_point ()
 

Public Attributes

 ACE_ALLOC_HOOK_DECLARE
 

Protected Member Functions

 ~ACE_Thread_Adapter ()
 Ensure that this object must be allocated on the heap.
 
- Protected Member Functions inherited from ACE_Base_Thread_Adapter
 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, long cancel_flags=0)
 Constructor.
 
void inherit_log_msg ()
 

Private Member Functions

virtual ACE_THR_FUNC_RETURN invoke_i ()
 

Private Attributes

ACE_Thread_Managerthr_mgr_
 Optional thread manager.
 

Additional Inherited Members

- Static Public Member Functions inherited from ACE_Base_Thread_Adapter
static void close_log_msg ()
 Invoke the close_log_msg_hook, if it is present.
 
static void sync_log_msg (const ACE_TCHAR *prog_name)
 Invoke the sync_log_msg_hook, if it is present.
 
static ACE_OS_Thread_Descriptorthr_desc_log_msg ()
 Invoke the thr_desc_log_msg_hook, if it is present.
 
- Protected Attributes inherited from ACE_Base_Thread_Adapter
ACE_THR_FUNC user_func_
 Thread startup function passed in by the user (C++ linkage).
 
voidarg_
 Argument to thread startup function.
 
ACE_THR_C_FUNC entry_point_
 
ACE_OS_Thread_Descriptorthr_desc_
 
ACE_OS_Log_Msg_Attributes log_msg_attributes_
 The ACE_Log_Msg attributes.
 
ACE_Service_Gestalt *const ctx_
 That is useful for gprof, define itimerval.
 
long flags_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ACE_Thread_Adapter()

ACE_Thread_Adapter::ACE_Thread_Adapter ( ACE_THR_FUNC user_func,
void * arg,
ACE_THR_C_FUNC entry_point = (ACE_THR_C_FUNCACE_THREAD_ADAPTER_NAME,
ACE_Thread_Manager * thr_mgr = 0,
ACE_Thread_Descriptor * td = 0,
long cancel_flags = 0 )

Constructor.

◆ ~ACE_Thread_Adapter()

ACE_Thread_Adapter::~ACE_Thread_Adapter ( )
protected

Ensure that this object must be allocated on the heap.

Member Function Documentation

◆ invoke()

ACE_THR_FUNC_RETURN ACE_Thread_Adapter::invoke ( )
virtual

Execute the <user_func_> with the <arg>. This function deletes this, thereby rendering the object useless after the call returns.

Implements ACE_Base_Thread_Adapter.

◆ invoke_i()

ACE_THR_FUNC_RETURN ACE_Thread_Adapter::invoke_i ( )
privatevirtual

Called by invoke, mainly here to separate the SEH stuff because SEH on Win32 doesn't compile with local vars with destructors.

◆ thr_mgr()

ACE_Thread_Manager * ACE_Thread_Adapter::thr_mgr ( )
inline

Accessor for the optional ACE_Thread_Manager.

Member Data Documentation

◆ ACE_ALLOC_HOOK_DECLARE

ACE_Thread_Adapter::ACE_ALLOC_HOOK_DECLARE

◆ thr_mgr_

ACE_Thread_Manager* ACE_Thread_Adapter::thr_mgr_
private

Optional thread manager.


The documentation for this class was generated from the following files: