CSharpTest.Net
IsLocked Property
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Synchronization Namespace > MutexLock Class : IsLocked Property

Glossary Item Box

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.NETCopy 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

Generated with Document! X 2011 by Innovasys