API Guides > ConceptRT 3.x
CriticalSection Class Reference

Abstraction of a critical section. A critical section object provides synchronization similar to that provided by a mutex object, except that a critical section can be used only by the threads of a single process. Event, mutex, and semaphore objects can also be used in a single-process application, but critical section objects provide a slightly faster, more efficient mechanism for mutual-exclusion synchronization. More...

Detailed Description

Abstraction of a critical section. A critical section object provides synchronization similar to that provided by a mutex object, except that a critical section can be used only by the threads of a single process. Event, mutex, and semaphore objects can also be used in a single-process application, but critical section objects provide a slightly faster, more efficient mechanism for mutual-exclusion synchronization.

+ Inheritance diagram for CriticalSection:

Public Member Methods

 CriticalSection ()
 Default constructor. More...
 
 ~CriticalSection ()
 Destructor. More...
 
void Lock ()
 Locks the CriticalSection. More...
 
void Unlock ()
 Locks the CriticalSection. More...
 
void SetIsWaitSectionEnabled (bool enable)
 Enable the section wait enter or not. More...
 
bool GetIsWaitSectionEnabled ()
 Query if the section wait has been enabled. More...
 

Constructor & Destructor Documentation

Default constructor.

Warning
Non-Deterministic. Determinism when using ConceptRT library can be ensure by using Context Time Critical mechanisms.

Destructor.

Warning
Non-Deterministic. Determinism when using ConceptRT library can be ensure by using Context Time Critical mechanisms.

Methods Documentation

bool GetIsWaitSectionEnabled ( )

Query if the section wait has been enabled.

Returns
True if enable, False if not.

Default : Enabled

void Lock ( )
virtual

Locks the CriticalSection.

Implements ILockable.

void SetIsWaitSectionEnabled ( bool  enable)

Enable the section wait enter or not.

Parameters
enableenable.

Default : Enabled

void Unlock ( )
virtual

Locks the CriticalSection.

Implements ILockable.