// $Id$ // ============================================================================ // // = LIBRARY // ace // // = FILENAME // Thread_Adapter.h // // = AUTHOR // Carlos O'Ryan // // ============================================================================ #ifndef ACE_OS_THREAD_ADAPTER_H #define ACE_OS_THREAD_ADAPTER_H #include "ace/pre.h" #include "ace/Base_Thread_Adapter.h" #if !defined (ACE_LACKS_PRAGMA_ONCE) # pragma once #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "ace/OS_Export.h" class ACE_OS_Export ACE_OS_Thread_Adapter : public ACE_Base_Thread_Adapter { // = TITLE // Converts a C++ function into a function // function that can be called from a thread creation routine // (e.g., 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 // . // // = DESCRIPTION // This class is used in . In general, the // thread that creates an object of this class is different from // the thread that calls on this object. Therefore, // the method is responsible for deleting itself. public: ACE_OS_Thread_Adapter (ACE_THR_FUNC user_func, void *arg, ACE_THR_C_FUNC entry_point = (ACE_THR_C_FUNC) ace_thread_adapter # if defined (ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS) , ACE_SEH_EXCEPT_HANDLER selector = 0 , ACE_SEH_EXCEPT_HANDLER handler = 0 # endif /* ACE_HAS_WIN32_STRUCTURAL_EXCEPTIONS */ ); // Constructor. virtual void *invoke (void); // Execute the with the . This function deletes // , thereby rendering the object useless after the call // returns. private: ~ACE_OS_Thread_Adapter (void); // Ensure that this object must be allocated on the heap. private: friend class ACE_Thread_Adapter_Has_Private_Destructor; // Friend declaration to avoid compiler warning: only defines a private // destructor and has no friends. }; # if defined (ACE_HAS_INLINED_OSCALLS) # if defined (ACE_INLINE) # undef ACE_INLINE # endif /* ACE_INLINE */ # define ACE_INLINE inline # include "ace/OS_Thread_Adapter.inl" # endif /* ACE_HAS_INLINED_OSCALLS */ #include "ace/post.h" #endif /* ACE_THREAD_ADAPTER_H */