Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members File Members Related Pages

# ACE_Thread_Adapter Class Reference

Converts a C++ function into a function 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 . More...

`#include <Thread_Adapter.h>`

Inheritance diagram for ACE_Thread_Adapter

[legend]
Collaboration diagram for ACE_Thread_Adapter:

[legend]
List of all members.

## Public Methods
| ACE_Thread_Adapter (ACE_THR_FUNC user_func, void *arg, ACE_THR_C_FUNC entry_point = (ACE_THR_C_FUNC) ace_thread_adapter, ACE_Thread_Manager *thr_mgr = 0, ACE_Thread_Descriptor *td = 0 )
virtual void* | invoke (void)
ACE_Thread_Manager* | thr_mgr (void)
| Accessor for the optional <Thread_Manager>.
## Private Methods
| ~ACE_Thread_Adapter (void)
| Ensure that this object must be allocated on the heap.
virtual void* | invoke_i (void)
| Called by invoke, mainly here to separate the SEH stuff because SEH on Win32 doesn't compile with local vars with destructors.
## Private Attributes
ACE_Thread_Manager* | thr_mgr_
| Optional thread manager.
## Friends
class | ACE_Thread_Adapter_Has_Private_Destructor

## Detailed Description

Converts a C++ function into a function 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 .

This class is used in . 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

const char *get_rcsid_ace _ ACE_Thread_Adapter::ACE_Thread_Adapter ( | ACE_THR_FUNC user_func,
| void * arg,
| ACE_THR_C_FUNC entry_point = (ACE_THR_C_FUNC) ace_thread_adapter,
| ACE_Thread_Manager * tm = 0,
| ACE_Thread_Descriptor * td = 0 )`[inline]`

  | Parameters:
  td | Constructor.

ACE_Thread_Adapter::~ACE_Thread_Adapter ( | void )`[private]`

| Ensure that this object must be allocated on the heap.

## Member Function Documentation

void * ACE_Thread_Adapter::invoke ( | void )`[virtual]`

| Execute the <user_func_> with the . This function deletes <this>, thereby rendering the object useless after the call returns. Reimplemented from ACE_Base_Thread_Adapter.

void * ACE_Thread_Adapter::invoke_i ( | void )`[private, virtual]`

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

ACE_INLINE ACE_Thread_Manager * ACE_Thread_Adapter::thr_mgr ( | void )

| Accessor for the optional <Thread_Manager>.

## Friends And Related Function Documentation

class ACE_Thread_Adapter_Has_Private_Destructor`[friend]`

| Friend declaration to avoid compiler warning: only defines a private destructor and has no friends. Reimplemented from ACE_Base_Thread_Adapter.

## Member Data Documentation

ACE_Thread_Manager * ACE_Thread_Adapter::thr_mgr_`[private]`

| Optional thread manager.

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

- Thread_Adapter.h
- Thread_Adapter.cpp
- Thread_Adapter.inl