Function CSPThreadLock::Lock()

Description:
It increments the thread lock count by one. If the object is locked by another thread, this member function waits until the object is unlocked.

Prototype:
unsigned long Lock();

Arguments:
No arguments (void).

Return value:
It returns the current thread lock count.

Examples:
//Global scope declarations
CSPThreadLock ThreadLock;
int a = 0;

...
...

//Thread sensitive code
ThreadLock.Lock();
a += 2;
ThreadLock.Unlock();

See also:
member functions Unlock(), TryLock()
CSPThreadLock | Other support classes | Class Categories | Online help home | Back

www.micronovae.com

Copyright © 2002 - 2005 Micronovae Ltd