CSharpTest.Net
SafeLock<TException> Constructor(Object)
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Synchronization Namespace > SafeLock<TException> Structure > SafeLock<TException> Constructor : SafeLock<TException> Constructor(Object)

monitor

Glossary Item Box

Acquires the monitor lock on the object within 2 minutes, or throws TimeoutException

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal monitor As Object _
)
C# 
public SafeLock<TException>( 
   object monitor
)

Parameters

monitor

Example

Library/Library.Test/LockingTests/TestLockingStructs.cs

C#Copy Code
object instance = new object();
using (new SafeLock<InvalidOperationException>(instance))
{ }
VB.NETCopy Code
Dim instance As New Object()
Using New SafeLock(Of InvalidOperationException)(instance)
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