Master Core  v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
CSemaphoreGrant Class Reference

RAII-style semaphore lock. More...

#include <sync.h>

+ Collaboration diagram for CSemaphoreGrant:

Public Member Functions

void Acquire ()
 
void Release ()
 
bool TryAcquire ()
 
void MoveTo (CSemaphoreGrant &grant)
 
 CSemaphoreGrant ()
 
 CSemaphoreGrant (CSemaphore &sema, bool fTry=false)
 
 ~CSemaphoreGrant ()
 
 operator bool ()
 

Private Attributes

CSemaphoresem
 
bool fHaveGrant
 

Detailed Description

RAII-style semaphore lock.

Definition at line 208 of file sync.h.

Constructor & Destructor Documentation

CSemaphoreGrant::CSemaphoreGrant ( )
inline

Definition at line 243 of file sync.h.

CSemaphoreGrant::CSemaphoreGrant ( CSemaphore sema,
bool  fTry = false 
)
inline

Definition at line 245 of file sync.h.

References Acquire(), and TryAcquire().

+ Here is the call graph for this function:

CSemaphoreGrant::~CSemaphoreGrant ( )
inline

Definition at line 252 of file sync.h.

References Release().

+ Here is the call graph for this function:

Member Function Documentation

void CSemaphoreGrant::Acquire ( )
inline

Definition at line 215 of file sync.h.

References CSemaphore::wait().

Referenced by CSemaphoreGrant().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void CSemaphoreGrant::MoveTo ( CSemaphoreGrant grant)
inline

Definition at line 235 of file sync.h.

References fHaveGrant, Release(), and sem.

Referenced by OpenNetworkConnection().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

CSemaphoreGrant::operator bool ( )
inline

Definition at line 256 of file sync.h.

References fHaveGrant.

void CSemaphoreGrant::Release ( )
inline

Definition at line 222 of file sync.h.

References CSemaphore::post().

Referenced by MoveTo(), ThreadSocketHandler(), and ~CSemaphoreGrant().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool CSemaphoreGrant::TryAcquire ( )
inline

Definition at line 229 of file sync.h.

References fHaveGrant, and CSemaphore::try_wait().

Referenced by CSemaphoreGrant().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

bool CSemaphoreGrant::fHaveGrant
private

Definition at line 212 of file sync.h.

Referenced by MoveTo(), operator bool(), and TryAcquire().

CSemaphore* CSemaphoreGrant::sem
private

Definition at line 211 of file sync.h.

Referenced by MoveTo().


The documentation for this class was generated from the following file: