CSingleLock::IsLocked
개체와 연결 된 경우 결정의 CSingleLock 개체가 신호 없음으로 됩니다 (사용할 수 없음).
BOOL IsLocked( );
반환 값
개체가 잠겨 있으면 0이 아닌. 그렇지 않으면 0입니다.
예제
// m_Mutex is a data member (of type CMutex)
// of an existing class that implements the resource being shared.
// Relate the synchronization object (m_Mutex) with
// our CSingleLock object.
CSingleLock singleLock(&m_Mutex);
// Attempt to lock the shared resource
singleLock.Lock(100); // Wait 100 ms...
// Has the resource been successfully locked?
if (singleLock.IsLocked())
{
// We were able to lock the resource;
// we may now work with the data associated with the mutex...
// Now that we are finished, unlock the resource for others.
singleLock.Unlock();
}
요구 사항
헤더: afxmt.h