Share via


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.

Return Value

Nonzero if the function was successful; otherwise 0.

Remarks

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.

Requirements

Header: afxmt.h

See Also

Reference

CMultiLock Class

Hierarchy Chart

Other Resources

CMultiLock Members