CSharpTest.Net
Read(Int32) Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Synchronization Namespace > ILockStrategy Interface > Read Method : Read(Int32) Method

timeout

Glossary Item Box

Returns a reader lock that can be elevated to a write lock

Syntax

Visual Basic (Declaration) 
Overloads Function Read( _
   ByVal timeout As Integer _
) As ReadLock
C# 
ReadLock Read( 
   int timeout
)

Parameters

timeout

Exceptions

ExceptionDescription
System.TimeoutExceptionThe exception that is thrown when the time allotted for a process or operation has expired.

Example

Library/Library.Test/LockingTests/BaseLockTest.cs

C#Copy Code
using (ILockStrategy l = LockFactory.Create())
{
    using (l.Write(0))
    { }
    using (l.Read(0))
    { }
}
VB.NETCopy Code
Using l As ILockStrategy = LockFactory.Create()
    Using l.Write(0)
    End Using
    Using l.Read(0)
    End Using
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