Interface
Constructor
os_sysv_semaphore_array(
os_vid_t id )
Constructs an object to
reference the existing semaphore array with ID id
.
Constructor
os_sysv_semaphore_array(
const os_key& key )
Constructs an object to
reference the existing semaphore array with key .
Throws: os_unix_toolkit_error
Constructor
os_sysv_semaphore_array(
int count ,
os_mode_t mode )
Constructs an object to
reference a new array of count semaphores with a
private key and access mode mode .
Throws: os_unix_toolkit_error
Constructor
os_sysv_semaphore_array(
const os_key& key ,
os_open_t open ,
int count ,
os_mode_t mode )
Constructs an object to
reference a new array of count semaphores with key
, open control flags, and mode mode
. If a semaphore array with key already exists,
references the existing semaphore array and ignores the mode
parameter.
Throws: os_unix_toolkit_error
<
bool
operator< ( const os_sysv_semaphore_array& array
) const
Returns true
if the ID is less than array .
==
bool
operator== ( const os_sysv_semaphore_array& array
) const
Returns true
if the ID is the same as array .
(os_vid_t)
operator
os_vid_t() const
Converts an object to the
IPC ID.
clear
void
clear()
Flushes any pending
operations without executing them.
creator_group
os_gid_t
creator_group() const
Returns the creator's
group ID.
Throws: os_unix_toolkit_error
creator_user
os_uid_t
creator_user() const
Returns the creator's
user ID.
Throws: os_unix_toolkit_error
defined
bool
defined() const
Returns true
if the ID is not OS_UNDEFINED .
execute
void
execute()
Atomically executes all
operations pending in the queue and clears the queue.
Throws: os_unix_toolkit_error
id
os_vid_t
id() const
Returns the IPC ID.
id
void
id( os_vid_t id )
Sets the ID to id
.
is_legal_index
bool
is_legal_index( int index )
const
Returns true
if index is a legal semaphore index.
Throws: os_unix_toolkit_error
key
os_key
key() const
Returns the key.
Throws: os_unix_toolkit_error
last_change_time
os_time_and_date
last_change_time() const
Returns the last time
that any of the semaphores changed.
Throws: os_unix_toolkit_error
last_op_time
os_time_and_date
last_op_time() const
Returns the last time an
operation was performed on any of the semaphores.
Throws: os_unix_toolkit_error
mode
os_mode_t
mode() const
Returns the mode.
Throws: os_unix_toolkit_error
mode
void
mode( os_mode_t mode )
Sets the mode to mode
.
Throws: os_unix_toolkit_error
op
void
op( int index ,
int operation ,
os_ioctl_t control )
Performs operation
on semaphore index with the specified control
flags (default blocking and undo
). If the object is in record mode, appends the operation to the pending
operations queue; otherwise, performs the operation immediately.
Throws: os_unix_toolkit_error
owner_group
os_gid_t
owner_group() const
Returns the owner's group
ID.
Throws: os_unix_toolkit_error
owner_group
void
owner_group( os_gid_t group )
Sets the owner's group to
group .
Throws: os_unix_toolkit_error
owner_user
os_uid_t
owner_user() const
Returns the owner's user
ID.
Throws: os_unix_toolkit_error
owner_user
void
owner_user( os_uid_t user )
Sets the owner's user to user
.
Throws: os_unix_toolkit_error
print
void
print( ostream& stream )
const
Prints ID and index to stream
.
record
bool
record() const
Returns true
if the object is in record mode.
record
void
record( bool flag )
Sets record mode to flag
.
remove
void
remove()
Immediately removes the
semaphore array from the operating system. Any processes still trying to
access the semaphores generate errors.
Throws: os_unix_toolkit_error
semaphore
os_sysv_semaphore
semaphore( int index )
Returns a semaphore that
references the index semaphore.
Throws: os_unix_toolkit_error
semaphore
const
os_sysv_semaphore semaphore( int index )
const
Returns a semaphore that
references the index semaphore.
Throws: os_unix_toolkit_error
size
size_t
size() const
Returns the number of
semaphores in the array.
Throws: os_unix_toolkit_error
slot_sequence_number
int
slot_sequence_number() const
Returns the slot usage
sequence number.
Throws: os_unix_toolkit_error