Returns true if this object holds a lock on the mutex
Syntax
Visual Basic (Declaration) | |
---|
Public ReadOnly Property IsLocked As Boolean |
C# | |
---|
public bool IsLocked {get;} |
Example
Library/Library.Test/LockingTests/TestMutexLock.cs
C# | Copy Code |
---|
using (MutexLock lck = new MutexLock(Guid.NewGuid().ToString()))
{
Assert.IsTrue(lck.IsLocked);
lck.Dispose();
Assert.IsFalse(lck.IsLocked);
} |
VB.NET | Copy Code |
---|
Using lck As New MutexLock(Guid.NewGuid().ToString())
Assert.IsTrue(lck.IsLocked)
lck.Dispose()
Assert.IsFalse(lck.IsLocked)
End Using |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also