#include <ace/SV_Semaphore_Simple.h>
class ACE_SV_Semaphore_Simple {
public:
enum{ ACE_CREATE = IPC_CREAT, ACE_EXCL = IPC_EXCL, ACE_OPEN = 0 };
ACE_SV_Semaphore_Simple (void);
ACE_SV_Semaphore_Simple ( key_t key, int flags = ACE_SV_Semaphore_Simple::ACE_CREATE, int initial_value = 1, u_short nsems = 1, int perms = ACE_DEFAULT_FILE_PERMS );
ACE_SV_Semaphore_Simple ( const char *name, int flags = ACE_SV_Semaphore_Simple::ACE_CREATE, int initial_value = 1, u_short nsems = 1, int perms = ACE_DEFAULT_FILE_PERMS );
~ACE_SV_Semaphore_Simple (void);
int open ( const char *name, int flags = ACE_SV_Semaphore_Simple::ACE_CREATE, int initial_value = 1, u_short nsems = 1, int perms = ACE_DEFAULT_FILE_PERMS );
int open ( key_t key, int flags = ACE_SV_Semaphore_Simple::ACE_CREATE, int initial_value = 1, u_short nsems = 1, int perms = ACE_DEFAULT_FILE_PERMS );
int close (void);
int remove (void) const;
int acquire (u_short n = 0, int flags = 0) const;
int acquire_read (u_short n = 0, int flags = 0) const;
int acquire_write (u_short n = 0, int flags = 0) const;
int tryacquire (u_short n = 0, int flags = 0) const;
int tryacquire_read (u_short n = 0, int flags = 0) const;
int tryacquire_write (u_short n = 0, int flags = 0) const;
int release (u_short n = 0, int flags = 0) const;
int op (int val, u_short semnum = 0, int flags = SEM_UNDO) const;
int op (sembuf op_vec[], u_short nsems) const;
int control (int cmd, semun arg, u_short n = 0) const;
int control (int cmd, int value = 0, u_short n = 0) const;
int get_id (void) const;
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
protected:
key_t key_;
int internal_id_;
int sem_number_;
int init ( key_t k = ACE_static_cast (key_t, ACE_INVALID_SEM_KEY), int i = -1 );
key_t name_2_key (const char *name);
};
ACE_SV_Semaphore_Simple (void);
ACE_SV_Semaphore_Simple (
key_t key,
int flags = ACE_SV_Semaphore_Simple::ACE_CREATE,
int initial_value = 1,
u_short nsems = 1,
int perms = ACE_DEFAULT_FILE_PERMS
);
ACE_SV_Semaphore_Simple (
const char *name,
int flags = ACE_SV_Semaphore_Simple::ACE_CREATE,
int initial_value = 1,
u_short nsems = 1,
int perms = ACE_DEFAULT_FILE_PERMS
);
~ACE_SV_Semaphore_Simple (void);
int open (
const char *name,
int flags = ACE_SV_Semaphore_Simple::ACE_CREATE,
int initial_value = 1,
u_short nsems = 1,
int perms = ACE_DEFAULT_FILE_PERMS
);
int open (
key_t key,
int flags = ACE_SV_Semaphore_Simple::ACE_CREATE,
int initial_value = 1,
u_short nsems = 1,
int perms = ACE_DEFAULT_FILE_PERMS
);
int close (void);
int remove (void) const;
close
below.
int acquire (u_short n = 0, int flags = 0) const;
int acquire_read (u_short n = 0, int flags = 0) const;
int acquire_write (u_short n = 0, int flags = 0) const;
int tryacquire (u_short n = 0, int flags = 0) const;
acquire
.
int tryacquire_read (u_short n = 0, int flags = 0) const;
int tryacquire_write (u_short n = 0, int flags = 0) const;
int release (u_short n = 0, int flags = 0) const;
int op (int val, u_short semnum = 0, int flags = SEM_UNDO) const;
int op (sembuf op_vec[], u_short nsems) const;
int control (int cmd, semun arg, u_short n = 0) const;
int control (int cmd, int value = 0, u_short n = 0) const;
int get_id (void) const;
void dump (void) const;
ACE_ALLOC_HOOK_DECLARE;
schmidt@cs.wustl.edu