Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Threads Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWCriticalSection

Module:  Threads   Package:  Synchronization


RWCriticalSection RWSynchObject

Local Index

Members

Non-Members

Header File

#include <rw/sync/RWCriticalSection.h>

Description

An RWCriticalSection object 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 CRITICAL_SECTION     RWCriticalSectionRep;
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 Constructors

RWCriticalSection(RWCancellationState
state=RW_CANCELLATION_DISABLED);
RWCriticalSection(RWStaticCtor);

Public Member Functions

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

Private Constructor

RWCriticalSection(const RWCriticalSection& second);

Private Member Operator

RWCriticalSection&
operator=(const RWCriticalSection& second);

See Also

RWMutexLock



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.