The C++ framework for developing highly scalable, high performance servers on Windows platforms.

CMutex Class Reference

Inheritance diagram for CMutex:
Collaboration diagram for CMutex:

List of all members.

Public Types

enum  AbandonedWaitHandling { IgnoreAbandonedWaits, FailOnAbandonedWaits }
 Specify how to deal with abandoned waits. More...
enum  InitialState { Owned, NotOwned }
 Specify the initial state of an event object. More...
enum  CreationFlags { CreateOrConnect, CreateNew, ConnectToExisting }
 Specify how to create or connect to an existing event object. More...
typedef
TLockableObjectOwner
< IReentrantLockableObject > 
Owner
typedef
TLockableObjectConditionalOwner
< IReentrantLockableObject > 
ConditionalOwner
typedef
TReentrantLockableObjectPotentialOwner
< IReentrantLockableObject > 
PotentialOwner

Public Member Functions

 CMutex (SECURITY_ATTRIBUTES *pSecurityAttributes=nullptr, AbandonedWaitHandling abandonedWaitHandling=FailOnAbandonedWaits, InitialState initialState=NotOwned)
 Create an anonymous CMutex object for in-process use.
 CMutex (const IKernelObjectName &name, SECURITY_ATTRIBUTES *pSecurityAttributes=nullptr, AbandonedWaitHandling abandonedWaitHandling=FailOnAbandonedWaits, InitialState initialState=NotOwned)
 Create a new named CMutex object or connect to an existing one with the same name, for cross-process use.
 CMutex (const IKernelObjectName &name, CreationFlags creationFlags, SECURITY_ATTRIBUTES *pSecurityAttributes=nullptr, AbandonedWaitHandling abandonedWaitHandling=FailOnAbandonedWaits, InitialState initialState=NotOwned)
 Create a new named CMutex object or connect to an existing one with the same name, for cross-process use. Use the CreationFlags to force creation only or connection only if required.
 CMutex (const CMutex &rhs)
 ~CMutex () override
CMutexoperator= (const CMutex &rhs)
bool TryLock () override
 Try to lock the lockable object, returns true if successful and false if the lock is already locked.
void Lock () override
 Lock the lockable object.
void Unlock () override
 Unlock the lockable object.
HANDLE GetWaitHandle () const override
void Wait () const override
bool Wait (Milliseconds timeout) const override


Member Typedef Documentation


Member Enumeration Documentation

Specify how to deal with abandoned waits.

Enumerator:
IgnoreAbandonedWaits 
FailOnAbandonedWaits 

Specify the initial state of an event object.

Enumerator:
Owned 
NotOwned 

Specify how to create or connect to an existing event object.

Enumerator:
CreateOrConnect 
CreateNew 
ConnectToExisting 


Constructor & Destructor Documentation

CMutex ( SECURITY_ATTRIBUTES pSecurityAttributes = nullptr,
AbandonedWaitHandling  abandonedWaitHandling = FailOnAbandonedWaits,
InitialState  initialState = NotOwned 
) [explicit]

Create an anonymous CMutex object for in-process use.

CMutex ( const IKernelObjectName name,
SECURITY_ATTRIBUTES pSecurityAttributes = nullptr,
AbandonedWaitHandling  abandonedWaitHandling = FailOnAbandonedWaits,
InitialState  initialState = NotOwned 
) [explicit]

Create a new named CMutex object or connect to an existing one with the same name, for cross-process use.

CMutex ( const IKernelObjectName name,
CreationFlags  creationFlags,
SECURITY_ATTRIBUTES pSecurityAttributes = nullptr,
AbandonedWaitHandling  abandonedWaitHandling = FailOnAbandonedWaits,
InitialState  initialState = NotOwned 
)

Create a new named CMutex object or connect to an existing one with the same name, for cross-process use. Use the CreationFlags to force creation only or connection only if required.

CMutex ( const CMutex rhs  ) 

~CMutex (  )  [override]


Member Function Documentation

CMutex& operator= ( const CMutex rhs  ) 

bool TryLock (  )  [override, virtual]

Try to lock the lockable object, returns true if successful and false if the lock is already locked.

Implements ILockableObject.

void Lock (  )  [override, virtual]

Lock the lockable object.

Implements ILockableObject.

void Unlock (  )  [override, virtual]

Unlock the lockable object.

Implements ILockableObject.

HANDLE GetWaitHandle (  )  const [override]

void Wait (  )  const [override]

bool Wait ( Milliseconds  timeout  )  const [override]


Generated on Sun Sep 12 19:11:38 2021 for The Server Framework - v7.4 by doxygen 1.5.3