aboutsummaryrefslogtreecommitdiff
path: root/externals/ace/Thread_Semaphore.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_Semaphore.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_Semaphore.h')
-rw-r--r--externals/ace/Thread_Semaphore.h87
1 files changed, 87 insertions, 0 deletions
diff --git a/externals/ace/Thread_Semaphore.h b/externals/ace/Thread_Semaphore.h
new file mode 100644
index 00000000000..d7013d9c3f2
--- /dev/null
+++ b/externals/ace/Thread_Semaphore.h
@@ -0,0 +1,87 @@
+// -*- C++ -*-
+
+//==========================================================================
+/**
+ * @file Thread_Semaphore.h
+ *
+ * $Id: Thread_Semaphore.h 86731 2009-09-17 12:23:48Z johnnyw $
+ *
+ * Moved from Synch.h.
+ *
+ * @author Douglas C. Schmidt <schmidt@cs.wustl.edu>
+ */
+//==========================================================================
+
+#ifndef ACE_THREAD_SEMAPHORE_H
+#define ACE_THREAD_SEMAPHORE_H
+#include /**/ "ace/pre.h"
+
+#include /**/ "ace/ACE_export.h"
+
+#if !defined (ACE_LACKS_PRAGMA_ONCE)
+# pragma once
+#endif /* ACE_LACKS_PRAGMA_ONCE */
+
+#if !defined (ACE_HAS_THREADS)
+# include "ace/Null_Semaphore.h"
+#else /* ACE_HAS_THREADS */
+// ACE platform supports some form of threading.
+
+#include "ace/Semaphore.h"
+
+ACE_BEGIN_VERSIONED_NAMESPACE_DECL
+
+/**
+ * @class ACE_Thread_Semaphore
+ *
+ * @brief Wrapper for Dijkstra style general semaphores that work
+ * only within one process.
+ */
+class ACE_Export ACE_Thread_Semaphore : public ACE_Semaphore
+{
+public:
+ /// Initialize the semaphore, with an initial value of @a count,
+ /// maximum value of @a max, and unlocked by default.
+ ACE_Thread_Semaphore (unsigned int count = 1, // By default make this unlocked.
+ const ACE_TCHAR *name = 0,
+ void * = 0,
+ int max = 0x7FFFFFFF);
+
+ /// Default dtor.
+ ~ACE_Thread_Semaphore (void);
+
+ /// Dump the state of an object.
+ void dump (void) const;
+
+ /// Declare the dynamic allocation hooks.
+ ACE_ALLOC_HOOK_DECLARE;
+};
+
+/*****************************************************************************/
+
+template <class T> class ACE_Malloc_Lock_Adapter_T;
+
+/**
+ * @brief Template specialization of ACE_Malloc_Lock_Adapter_T for
+ * ACE_Thread_Semaphore.
+ *
+ * This is needed since the ctor for ACE_Thread_Semaphore doesn't match
+ * the standard form used by other lock strategy classes.
+ */
+template<>
+class ACE_Export ACE_Malloc_Lock_Adapter_T<ACE_Thread_Semaphore>
+{
+public:
+ ACE_Thread_Semaphore * operator () (const ACE_TCHAR *name);
+};
+
+ACE_END_VERSIONED_NAMESPACE_DECL
+
+#if defined (__ACE_INLINE__)
+#include "ace/Thread_Semaphore.inl"
+#endif /* __ACE_INLINE__ */
+
+#endif /* !ACE_HAS_THREADS */
+
+#include /**/ "ace/post.h"
+#endif /* ACE_THREAD_SEMAPHORE_H */