NAME
ACE_Process_Semaphore -
Wrapper for Dijkstra style general semaphores that work
across processes.
SYNOPSIS
#include <ace/Synch.h>
class ACE_Process_Semaphore
{
public:
ACE_Process_Semaphore (
u_int count,
LPCTSTR name = 0,
void * = 0,
int max = 0x7FFFFFFF
);
~ACE_Process_Semaphore (void);
int remove (void);
int acquire (void);
int tryacquire (void);
int release (void);
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
private:
ACE_Semaphore lock_;
ACE_SV_Semaphore_Complex lock_;
};
DESCRIPTION
Wrappers for various synchronization routines.
PUBLIC MEMBERS
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 MEMBERS
ACE_Semaphore lock_;
ACE_SV_Semaphore_Complex lock_;
We need this to get the right semantics...
AUTHOR
Doug Schmidt
LIBRARY
ace