Visual Basic (Declaration) | |
---|---|
Public Structure SafeLock Inherits System.ValueType |
C# | |
---|---|
public struct SafeLock : System.ValueType |
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 |
System.Object
System.ValueType
CSharpTest.Net.Synchronization.SafeLock
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7