From 32546e22828e793e3881e1055acb72b6a044e331 Mon Sep 17 00:00:00 2001 From: Rat Date: Mon, 7 Jun 2010 19:10:55 +0200 Subject: added ace + vcproj for win --HG-- branch : trunk --- externals/ace/OS_Thread_Adapter.h | 71 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 externals/ace/OS_Thread_Adapter.h (limited to 'externals/ace/OS_Thread_Adapter.h') diff --git a/externals/ace/OS_Thread_Adapter.h b/externals/ace/OS_Thread_Adapter.h new file mode 100644 index 00000000000..4dc3cee0911 --- /dev/null +++ b/externals/ace/OS_Thread_Adapter.h @@ -0,0 +1,71 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file OS_Thread_Adapter.h + * + * $Id: OS_Thread_Adapter.h 85341 2009-05-14 11:07:37Z johnnyw $ + * + * @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/ACE_export.h" + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +/** + * @class ACE_OS_Thread_Adapter + * + * @brief 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. + */ +class ACE_Export ACE_OS_Thread_Adapter : public ACE_Base_Thread_Adapter +{ +public: + /// Constructor. + ACE_OS_Thread_Adapter (ACE_THR_FUNC user_func, + void *arg, + ACE_THR_C_FUNC entry_point = (ACE_THR_C_FUNC) ACE_THREAD_ADAPTER_NAME +# 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 */ + ); + + /** + * Execute the @a user_func_ with the @a arg. This function deletes + * @c this, thereby rendering the object useless after the call + * returns. + */ + virtual ACE_THR_FUNC_RETURN invoke (void); + +protected: + + /// Ensure that this object is allocated on the heap. + ~ACE_OS_Thread_Adapter (void); +}; + +ACE_END_VERSIONED_NAMESPACE_DECL + +#include /**/ "ace/post.h" +#endif /* ACE_THREAD_ADAPTER_H */ -- cgit v1.2.3