Main Page   Class Hierarchy   Compound List   File List   Compound Members  

RIPCMutex Class Reference

#include <RIPCMutex.h>

Inheritance diagram for RIPCMutex:

RIPCPrimitive List of all members.

Public Types

enum  RIPCPrimitiveType {
  RIPC_MUTEX, RIPC_EVENT, RIPC_SEMAPHORE, RIPC_BARRIER,
  RIPC_LOCK, RIPC_SHARED_MEMORY, RIPC_QUEUE
}
enum  RIPCRanks { DEFAULT_RANK = 0 }

Public Methods

void lock ()
bool lock (unsigned timeout)
virtual void priorityLock (int rank)=0
virtual bool priorityLock (int rank, unsigned timeout)=0
virtual void unlock ()=0
RIPCPrimitiveType getType ()
char const * getTypeName ()
virtual char const * getName ()=0
virtual bool alreadyExists ()=0
void waitFor ()
bool waitFor (unsigned timeout)
virtual void priorityWait (int rank)=0
virtual bool priorityWait (int rank, unsigned timeout)=0
virtual void reset ()=0
virtual void close ()=0
virtual void * allocate (size_t size)
virtual void deallocate (void *obj, size_t size=0)

Static Public Methods

void deallocator (RIPCObject const &objDesc)

Detailed Description

Synchronization object providing mutual exclusion. Mutex object supports nested locks, it means that if some session locks mutex N times, it should unlock it N time to release the mutex. Server is able to detect deadlock for mutexes.

Semantic of methods inherited from RIPCPrimitive:

waitFor
lock the mutex
reset
release the mutex (remove all locks). It is not required that session, invoking reset method be owner of the mutex


Member Enumeration Documentation

enum RIPCPrimitive::RIPCPrimitiveType [inherited]
 

Primitive types


Member Function Documentation

virtual void* RIPCPrimitive::allocate size_t    size [virtual, inherited]
 

Method for allocation memory for container elements (currently queue and shared memory). This method can be overriden by derived class* to provide custom allocation policy.

virtual bool RIPCPrimitive::alreadyExists   [pure virtual, inherited]
 

Primitive returned by createXXX method already exists This method should be call immediatly after createXXX to check if new primitive was created or existed one was returned.

Returns:
true if createXXX method doesn't create new primitive

virtual void RIPCPrimitive::close   [pure virtual, inherited]
 

Close primitive. This method decrease access counter of the primitive and once it becomes zero, primitive is destroyed.

virtual void RIPCPrimitive::deallocate void *    obj,
size_t    size = 0
[virtual, inherited]
 

Method for deallocation memory for container elements (currently queue and shared memory). This method can be overriden by derived class to provide custom allocation policy.

virtual char const* RIPCPrimitive::getName   [pure virtual, inherited]
 

Get primitive name. Name of the primitive is unique with primitives of the same type (events, semaphores,...). It is possible that, for example, event and mutex has the same name.

Returns:
primitive name

RIPCPrimitiveType RIPCMutex::getType   [inline, virtual]
 

Get RIPC primitive type

Returns:
one of the constants from RIPCPrimitiveType enum

Implements RIPCPrimitive.

char const* RIPCPrimitive::getTypeName   [inherited]
 

Get RIPC primitive type name

Returns:
name of primitive type

bool RIPCMutex::lock unsigned    timeout [inline]
 

Try to lock the mutex with specified timeout. If lock can not be granted within specified time, request is failed.

Parameters:
timeout  timeout in milliseconds
Returns:
true if lock is granted, false of timeout is expired

void RIPCMutex::lock   [inline]
 

Lock mutex. Only one session can lock mutex each moment of time.

virtual bool RIPCMutex::priorityLock int    rank,
unsigned    timeout
[pure virtual]
 

Try to lock the mutex with specified timeout. If lock can not be granted within specified time, request is failed.

Parameters:
rank  processes will be placed in wait queue in the order of increasing rank value and in the same order will be taken from the queue.
timeout  timeout in milliseconds
Returns:
true if lock is granted, false of timeout is expired

virtual void RIPCMutex::priorityLock int    rank [pure virtual]
 

Lock mutex. Only one session can lock mutex each moment of time.

Parameters:
rank  processes will be placed in wait queue in the order of increasing rank value and in the same order will be taken from the queue.

virtual bool RIPCPrimitive::priorityWait int    rank,
unsigned    timeout
[pure virtual, inherited]
 

Priority wait until state of primitive is switched with timeout. Requests with the lowest rank value will be satisfied first. Semantic of this method depends on particular primitive type and is explained in specification of each primitive.

Parameters:
rank  processes will be placed in wait queue in the order of increasing rank value and in the same order will be taken from the queue.
timeout  operation timeout in millisoconds
Returns:
false if timeout is expired before primitive state is changed

virtual void RIPCPrimitive::priorityWait int    rank [pure virtual, inherited]
 

Priority wait until state of primitive is switched. Requests with the lowest rank value will be satisfied first. Semantic of this method depends on particular primitive type and is explained in specification of each primitive.

Parameters:
rank  processes will be placed in wait queue in the order of increasing rank value and in the same order will be taken from the queue.

virtual void RIPCPrimitive::reset   [pure virtual, inherited]
 

Reset primitive. Semantic of this method depends on particular primitive type and is explained in specification of each primitive.

virtual void RIPCMutex::unlock   [pure virtual]
 

Unlock mutex. This method release the mutex if number of unlocks is equal to number of locks

bool RIPCPrimitive::waitFor unsigned    timeout [inline, inherited]
 

Wait until state of primitive is switched with timeout. Semantic of this method depends on particular primitive type and is explained in specification of each primitive.

Returns:
false if timeout is expired before primitive state is changed

void RIPCPrimitive::waitFor   [inline, inherited]
 

Wait until state of primitive is switched. Semantic of this method depends on particular primitive type and is explained in specification of each primitive.


The documentation for this class was generated from the following file:
Generated on Tue Jul 8 20:27:57 2003 for RIPC by doxygen1.2.15