Download Source Code

CTlLocalLock Class Reference

Use this to lock and automatically unlock CTlLock objects. More...

#include <ThreadSafe.h>

Collaboration diagram for CTlLocalLock:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CTlLocalLock ()
 Default constructor.
 CTlLocalLock (CTlLock *ptr, DWORD timeout=3000)
 Constructor - Takes a CTlLock pointer.
 CTlLocalLock (CTlLock &lock, DWORD timeout=3000)
 Constructor - Takes a CTlLock reference.
 ~CTlLocalLock ()
 Destructor - Unlocks the underlying lock.
BOOL IsLocked ()
 Returns true if the local object is locked.
void Attach (CTlLock *ptr)
 Attaches to an existing CTlLock without locking.
void Detach ()
 Detaches from CTlLock without unlocking.
BOOL Lock (CTlLock *ptr, DWORD timeout=3000)
 Locks a CTlLock object. Returns true only if lock was achieved.
BOOL Unlock ()
 Unlocks attached CTlLock object.

Detailed Description

Use this to lock and automatically unlock CTlLock objects.

Use this to lock and automatically unlock CTlLock objects


Constructor & Destructor Documentation

CTlLocalLock::CTlLocalLock CTlLock ptr,
DWORD  timeout = 3000
[inline]
 

Constructor - Takes a CTlLock pointer.

Parameters:
[in] ptr - Pointer to CTlLock object
[in] timeout - Maximum time in milli-seconds to wait for lock.

CTlLocalLock::CTlLocalLock CTlLock lock,
DWORD  timeout = 3000
[inline]
 

Constructor - Takes a CTlLock reference.

Parameters:
[in] lock - Reference to CTlLock object
[in] timeout - Maximum time in milli-seconds to wait for lock.


Member Function Documentation

BOOL CTlLocalLock::Lock CTlLock ptr,
DWORD  timeout = 3000
[inline]
 

Locks a CTlLock object. Returns true only if lock was achieved.

Parameters:
[in] ptr - Pointer to CTlLock object
[in] timeout - Maximum time in milli-seconds to wait for lock.
Returns:
Non-zero if lock was acquired.
See also:

BOOL CTlLocalLock::Unlock  )  [inline]
 

Unlocks attached CTlLock object.

Returns:
Always returns non-zero


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