Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWCriticalSection


RWCriticalSection RWSynchObject

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Data Types

Member Functions

Package

Synchronization

Header File

#include <rw/sync/RWCriticalSection.h> 

Description

An RWCriticalSection is used to provide mutual exclusion for a critical section of code (sections of code where only one thread should be executing at a time). This lock operates in a manner that is identical to RWMutexLock except that on certain platforms, for example Win32, it may yield superior performance when there is minimal contention for the lock.

Example

Global Typedef

typedef RWMutexLockRep     RWCriticalSectionRep;

Member Typedefs

typedef RWTLockGuard<RWCriticalSection>     LockGuard;
typedef RWTLockGuard<RWCriticalSection>     ReadLockGuard;
typedef RWTLockGuard<RWCriticalSection>     WriteLockGuard;
typedef RWTUnlockGuard<RWCriticalSection>   UnlockGuard;
typedef RWTUnlockGuard<RWCriticalSection>   ReadUnlockGuard;
typedef RWTUnlockGuard<RWCriticalSection>   WriteUnlockGuard;

Public Constructor

RWCriticalSection(RWCancellationState
state=RW_CANCELLATION_DISABLED);

Public Member Functions

void
acquire(void);
void
acquireRead(void);
void
acquireWrite(void);
RWCriticalSectionRep*
getCriticalSectionRep(void) const;
void
release(void);

See Also

RWMutexLock



Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.