Releases the lock on the mutex, and if created by this closes the mutex
Syntax
Visual Basic (Declaration) | |
---|
Public Sub Dispose() |
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