UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | List of all members
LockBlock Class Reference

#include <pep_ipc.H>

Inheritance diagram for LockBlock:
ObjectIPC

Public Member Functions

 LockBlock (int elem_cnt, key_t k_sem)
 
 LockBlock (int elem_cnt)
 
virtual ~LockBlock ()
 
void lock (int id)
 
void unlock (int id)
 
int resources ()
 
void force_destroy ()
 
virtual int attach_cnt ()
 
- Public Member Functions inherited from ObjectIPC
 ObjectIPC (key_t id_k)
 
virtual key_t key ()
 

Additional Inherited Members

- Protected Member Functions inherited from ObjectIPC
void new_key ()
 

Detailed Description

Used for independent locking of vector elements. Each element is resource representation. Locking of an element means that other concurrent processes that use the same object to be aware of synchronous access will wait during lock() method until unlock() will be called.

Constructor & Destructor Documentation

LockBlock::LockBlock ( int  elem_cnt,
key_t  k_sem 
)

Access to existant locking block and check it for min count of elements if elem_cnt = 0

LockBlock::LockBlock ( int  elem_cnt)

Create new locking block for pointed count of elements

virtual LockBlock::~LockBlock ( )
virtual

If this object has the last connection with the semaphore it delete sem_id

Member Function Documentation

virtual int LockBlock::attach_cnt ( )
virtual

Returns count of attached processes (users)

Reimplemented from ObjectIPC.

void LockBlock::force_destroy ( )
inline

Disable destruction of a semaphore due to existant attachments

void LockBlock::lock ( int  id)

Lock resource with pointed id

int LockBlock::resources ( )

Return count of handled resources

void LockBlock::unlock ( int  id)

Unlock without any checking of validity


The documentation for this class was generated from the following file: