Export (0) Print
Expand All

CMultiLock::Unlock 

Releases the synchronization object owned by CMultiLock.


BOOL Unlock( ); 
BOOL Unlock(
   LONG lCount,
   LPLONG lPrevCount = NULL 
);

Parameters

lCount

Number of reference counts to release. Must be greater than 0. If the specified amount would cause the object's count to exceed its maximum, the count is not changed and the function returns FALSE.

lPrevCount

Points to a variable to receive the previous count for the synchronization object. If NULL, the previous count is not returned.

Nonzero if the function was successful; otherwise 0.

This function is called by CMultiLock's destructor.

The first form of Unlock tries to unlock the synchronization object managed by CMultiLock. The second form of Unlock tries to unlock the CSemaphore objects owned by CMultiLock. If CMultiLock does not own any locked CSemaphore object, the function returns FALSE; otherwise, it returns TRUE. lCount and lpPrevCount are exactly the same as the parameters of CSingleLock::Unlock. The second form of Unlock is rarely applicable to multilock situations.

Community Additions

ADD
Show:
© 2014 Microsoft