CriticalSection Class Reference

Inheritance diagram for CriticalSection:

Lockable NonCopyable List of all members.

Detailed Description

Critical Section synchronization object.

This class is used for intra-process synchronization.

It implements Lockable interface for Win32 and *nix platform (based on CRITICAL_SECTION structure for Win32 and on pthread_mutex for *nix).

Public Member Functions

Classes


Constructor & Destructor Documentation

CriticalSection (  ) 

Critical Section construction.

The constructor initializes the synchronization object.

~CriticalSection (  ) 

Critical Section destruction.

The destructor deletes the synchronization object.


Member Function Documentation

void enter (  )  [virtual]

Lock synchronization object.

If synchronization object is not locked by another thread or process, then it will be locked.

If synchronization object is already locked by another thread or process, then this method waits for this object and lock it.

After synchronization object was locked it should be unlocked by leave() method.

Warning:
There is deadlock possible.

Implements Lockable.

void leave (  )  [virtual]

Unlock synchronization object.

This method unlocks the synchronization object locked by enter() method.

Implements Lockable.


Generated on Wed Jun 6 17:27:47 2007 for OMNI by  doxygen 1.5.2