class CSingleLock

More...

Definition#include <classlib/include/classlib/mtsync.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Members


Detailed Description

class CSingleLock

It's a locker object. The class CSingleLock try to acquire the object passed as parameter.


	Example:
	
	...
	...
	CMutex mtx;
	...
	...
	// this function acquire the mutex and release it before return to the caller.
	int mySynchronizedFun()
	{
	    CSingleLock lck(mtx, TRUE);
	    ...
	    ...
	    if(someCondition)
	        return -1;
	    ...
	    ...
	    return 0;
	}
	...
	...


 CSingleLock (CSyncObject* pObject, BOOL bInitialLock = FALSE)

CSingleLock

Build the locker. If bInitialLock is TRUE try to acquire immediately the synchronization object.

 ~CSingleLock ()

~CSingleLock

[virtual]

Destroy the locker, releasing the synchronization object.

BOOL  Lock (DWORD dwTimeOut = INFINITE)

Lock

Lock the synchronization object.

BOOL  Unlock ()

Unlock

Unlock the synchronization object.

BOOL  Unlock (LONG , LPLONG = NULL)

Unlock

Lock the synchronization object.

BOOL  IsLocked ()

IsLocked

Return TRUE if the synchronization object is locked.

CSyncObject* m_pObject

m_pObject

[protected]

BOOL m_bAcquired

m_bAcquired

[protected]


Generated by: nicola on gulliver.wadahome.it on Sun May 25 13:54:34 2003, using kdoc 2.0a53.