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

Glossary Item Box

Releases the lock on the mutex, and if created by this closes the mutex

Syntax

Visual Basic (Declaration) 
Public Sub Dispose() 
C# 
public void 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.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