Visual Basic (Declaration) | |
---|---|
Public Function New( _ ByVal monitor As Object, _ ByVal timeoutMilliseconds As Integer _ ) |
C# | |
---|---|
public SafeLock( object monitor, int timeoutMilliseconds ) |
Parameters
- monitor
- timeoutMilliseconds
Library/Library.Test/LockingTests/TestLockingStructs.cs
C# | Copy Code |
---|---|
object instance = new object(); using (IDisposable safeLock = new SafeLock(instance, 0)) { safeLock.Dispose();//since the using statement has the same boxed pointer to r, we are allowed to dispose } |
VB.NET | Copy Code |
---|---|
Dim instance As New Object() Using safeLock As IDisposable = New SafeLock(instance, 0) 'since the using statement has the same boxed pointer to r, we are allowed to dispose safeLock.Dispose() End Using |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
SafeLock StructureSafeLock Members
Overload List