summaryrefslogtreecommitdiff
path: root/ace/Synch.h
diff options
context:
space:
mode:
Diffstat (limited to 'ace/Synch.h')
-rw-r--r--ace/Synch.h89
1 files changed, 44 insertions, 45 deletions
diff --git a/ace/Synch.h b/ace/Synch.h
index 030f7996c8b..bcc3e52c1a6 100644
--- a/ace/Synch.h
+++ b/ace/Synch.h
@@ -1,7 +1,6 @@
/* -*- C++ -*- */
// $Id$
-
// ============================================================================
//
// = LIBRARY
@@ -106,6 +105,50 @@ protected:
ACE_File_Lock (const ACE_File_Lock &) {}
};
+class ACE_Export ACE_Process_Semaphore
+ // = TITLE
+ // Wrapper for Dijkstra style general semaphores that work
+ // across processes.
+{
+public:
+ ACE_Process_Semaphore (u_int count, LPCTSTR name = 0,
+ void * = 0, int max = 0x7FFFFFFF);
+ // Initialize the semaphore, with an initial value of <count> and a
+ // maximum value of <max>.
+
+ ~ACE_Process_Semaphore (void);
+ // Implicitly destroy the semaphore.
+
+ int remove (void);
+ // Explicitly destroy the semaphore.
+
+ int acquire (void);
+ // Block the thread until the semaphore count becomes
+ // greater than 0, then decrement it.
+
+ int tryacquire (void);
+ // Conditionally decrement the semaphore if count is greater
+ // than 0 (i.e., won't block).
+
+ int release (void);
+ // Increment the semaphore, potentially unblocking
+ // a waiting thread.
+
+ void dump (void) const;
+ // Dump the state of an object.
+
+ ACE_ALLOC_HOOK_DECLARE;
+ // Declare the dynamic allocation hooks.
+
+private:
+#if defined (ACE_WIN32) || defined (ACE_HAS_POSIX_SEM)
+ ACE_Semaphore lock_;
+#else
+ ACE_SV_Semaphore_Complex lock_;
+ // We need this to get the right semantics...
+#endif /* ACE_WIN32 */
+};
+
#if defined (ACE_HAS_THREADS) // ACE platform supports some form of threading.
class ACE_Export ACE_Event
@@ -679,50 +722,6 @@ public:
// Declare the dynamic allocation hooks.
};
-class ACE_Export ACE_Process_Semaphore
- // = TITLE
- // Wrapper for Dijkstra style general semaphores that work
- // across processes.
-{
-public:
- ACE_Process_Semaphore (u_int count, LPCTSTR name = 0,
- void * = 0, int max = 0x7FFFFFFF);
- // Initialize the semaphore, with an initial value of <count> and a
- // maximum value of <max>.
-
- ~ACE_Process_Semaphore (void);
- // Implicitly destroy the semaphore.
-
- int remove (void);
- // Explicitly destroy the semaphore.
-
- int acquire (void);
- // Block the thread until the semaphore count becomes
- // greater than 0, then decrement it.
-
- int tryacquire (void);
- // Conditionally decrement the semaphore if count is greater
- // than 0 (i.e., won't block).
-
- int release (void);
- // Increment the semaphore, potentially unblocking
- // a waiting thread.
-
- void dump (void) const;
- // Dump the state of an object.
-
- ACE_ALLOC_HOOK_DECLARE;
- // Declare the dynamic allocation hooks.
-
-private:
-#if defined (ACE_WIN32) || defined (ACE_HAS_POSIX_SEM)
- ACE_Semaphore lock_;
-#else
- ACE_SV_Semaphore_Complex lock_;
- // We need this to get the right semantics...
-#endif /* ACE_WIN32 */
-};
-
struct ACE_Export ACE_Sub_Barrier
{
// = Initialization.