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

# ACE_OS_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 <OS_Thread_Adapter.h>`

Inheritance diagram for ACE_OS_Thread_Adapter:

[legend]
Collaboration diagram for ACE_OS_Thread_Adapter:

[legend]
List of all members.

## Public Methods
| ACE_OS_Thread_Adapter (ACE_THR_FUNC user_func, void *arg, ACE_THR_C_FUNC entry_point=(ACE_THR_C_FUNC) ace_thread_adapter)
| Constructor. More...
virtual ACE_THR_FUNC_RETURN | invoke (void)
## Private Methods
| ~ACE_OS_Thread_Adapter (void)
| Ensure that this object must be allocated on the heap. More...
## Friends
class | ACE_Thread_Adapter_Has_Private_Destructor
| Friend declaration to avoid compiler warning: only defines a private destructor and has no friends. More...

## 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_OS_Thread_Adapter::ACE_OS_Thread_Adapter | ( | ACE_THR_FUNC | user_func,
|  | void * | arg,
|  | ACE_THR_C_FUNC | entry_point = (ACE_THR_C_FUNC) ace_thread_adapter
| ) |

| Constructor.

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

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

## Member Function Documentation

ACE_THR_FUNC_RETURN ACE_OS_Thread_Adapter::invoke | ( | void |  | ) | `[virtual]`

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

## Friends And Related Function Documentation

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

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

- OS_Thread_Adapter.h
- OS_Thread_Adapter.cpp