Download Source Code

CTlLock Class Reference

Thread locking mechanism. More...

#include <ThreadSafe.h>

Inheritance diagram for CTlLock:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CTlLock ()
 Creates default lock object.
 CTlLock (LPCTSTR pName)
 Creates named lock object.
 ~CTlLock ()
 Destructor.
BOOL Lock (DWORD timeout=3000)
 Locks the object.
BOOL Unlock ()
 Unlocks the object.
BOOL IsLocked ()
 Returns non-zero if locked.

Detailed Description

Thread locking mechanism.

Encapsulates a Windows Mutex object to provide thread locking.


Constructor & Destructor Documentation

CTlLock::CTlLock LPCTSTR  pName  )  [inline]
 

Creates named lock object.

Parameters:
[in] pName - Name for mutex


Member Function Documentation

BOOL CTlLock::IsLocked  )  [inline]
 

Returns non-zero if locked.

Checks to see if the object is locked. Does not mean the caller owns the lock

BOOL CTlLock::Lock DWORD  timeout = 3000  )  [inline]
 

Locks the object.

Parameters:
[in] timeout - Maximum time in milli-seconds to wait for lock
Returns:
Non-zero if success


The documentation for this class was generated from the following file:
  • inc/ThreadSafe.h
Copyright Robert Umbehant
This documentation is covered by the LGPL