aboutsummaryrefslogtreecommitdiff
path: root/externals/ace/Thread_Adapter.h
diff options
context:
space:
mode:
authorXanadu <none@none>2010-07-20 02:49:28 +0200
committerXanadu <none@none>2010-07-20 02:49:28 +0200
commit79622802f397258ee0f34327ba3ae6977ca3e7ff (patch)
tree1868946c234ab9ee256a6b7766a15713eae94235 /externals/ace/Thread_Adapter.h
parent7dd2dc91816ab8b3bc3b99a1b1c99c7ea314d5a8 (diff)
parentf906976837502fa5aa81b982b901d1509f5aa0c4 (diff)
Merge. Revision history for source files should be all back now.
--HG-- branch : trunk rename : sql/CMakeLists.txt => sql/tools/CMakeLists.txt rename : src/server/game/Pools/PoolHandler.cpp => src/server/game/Pools/PoolMgr.cpp rename : src/server/game/Pools/PoolHandler.h => src/server/game/Pools/PoolMgr.h rename : src/server/game/PrecompiledHeaders/NixCorePCH.cpp => src/server/game/PrecompiledHeaders/gamePCH.cpp rename : src/server/game/PrecompiledHeaders/NixCorePCH.h => src/server/game/PrecompiledHeaders/gamePCH.h
Diffstat (limited to 'externals/ace/Thread_Adapter.h')
-rw-r--r--externals/ace/Thread_Adapter.h100
1 files changed, 100 insertions, 0 deletions
diff --git a/externals/ace/Thread_Adapter.h b/externals/ace/Thread_Adapter.h
new file mode 100644
index 00000000000..8f1f259eff3
--- /dev/null
+++ b/externals/ace/Thread_Adapter.h
@@ -0,0 +1,100 @@
+// -*- C++ -*-
+
+//=============================================================================
+/**
+ * @file Thread_Adapter.h
+ *
+ * $Id: Thread_Adapter.h 80826 2008-03-04 14:51:23Z wotte $
+ *
+ * @author Carlos O'Ryan <coryan@uci.edu>
+ */
+//=============================================================================
+
+#ifndef ACE_THREAD_ADAPTER_H
+#define ACE_THREAD_ADAPTER_H
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/ACE_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#include "ace/Base_Thread_Adapter.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+// Forward decl.
+class ACE_Thread_Manager;
+class ACE_Thread_Descriptor;
+
+/**
+ * @class ACE_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 @c invoke() on this object. Therefore,
+ * the @c invoke() method is responsible for deleting itself.
+ */
+class ACE_Export ACE_Thread_Adapter : public ACE_Base_Thread_Adapter
+{
+public:
+ /// Constructor.
+ 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
+# 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 <user_func_> with the <arg>. This function deletes
+ * @c this, thereby rendering the object useless after the call
+ * returns.
+ */
+ virtual ACE_THR_FUNC_RETURN invoke (void);
+
+ /// Accessor for the optional ACE_Thread_Manager.
+ ACE_Thread_Manager *thr_mgr (void);
+
+protected:
+
+ /// Ensure that this object must be allocated on the heap.
+ ~ACE_Thread_Adapter (void);
+
+private:
+
+ /// Called by invoke, mainly here to separate the SEH stuff because
+ /// SEH on Win32 doesn't compile with local vars with destructors.
+ virtual ACE_THR_FUNC_RETURN invoke_i (void);
+
+private:
+
+ /// Optional thread manager.
+ ACE_Thread_Manager *thr_mgr_;
+
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+# if defined (ACE_HAS_INLINED_OSCALLS)
+# if defined (ACE_INLINE)
+# undef ACE_INLINE
+# endif /* ACE_INLINE */
+# define ACE_INLINE inline
+# include "ace/Thread_Adapter.inl"
+# endif /* ACE_HAS_INLINED_OSCALLS */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_THREAD_ADAPTER_H */