#include <ace/Synch.h>
class ACE_Process_Semaphore {
public:
ACE_Process_Semaphore ( u_int count = 1, LPCTSTR name = 0, void * = 0, int max = 0x7FFFFFFF );
~ACE_Process_Semaphore (void);
int remove (void);
int acquire (void);
int tryacquire (void);
int release (void);
int acquire_read (void);
int acquire_write (void);
int tryacquire_read (void);
int tryacquire_write (void);
const ACE_sema_t &lock (void) const;
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
protected:
ACE_Semaphore lock_;
ACE_SV_Semaphore_Complex lock_;
};
ACE_Process_Semaphore (
u_int count = 1,
LPCTSTR name = 0,
void * = 0,
int max = 0x7FFFFFFF
);
count
and a
maximum value of max
.
~ACE_Process_Semaphore (void);
int remove (void);
int acquire (void);
int tryacquire (void);
errno
is set to
EBUSY
.
int release (void);
int acquire_read (void);
acquire
and is only
here to make the ACE_Process_Semaphore
interface consistent
with the other synchronization APIs.
int acquire_write (void);
acquire
and is only
here to make the ACE_Process_Semaphore
interface consistent
with the other synchronization APIs.
int tryacquire_read (void);
tryacquire
and is only here to make the ACE_Process_Semaphore
interface consistent with the other synchronization APIs.
Returns -1 on failure. If we "failed" because someone else
already had the lock, errno
is set to EBUSY
.
int tryacquire_write (void);
tryacquire
and is only here to make the ACE_Process_Semaphore
interface consistent with the other synchronization APIs.
Returns -1 on failure. If we "failed" because someone else
already had the lock, errno
is set to EBUSY
.
const ACE_sema_t &lock (void) const;
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
ACE_Semaphore lock_;
ACE_SV_Semaphore_Complex lock_;