Visual Basic (Declaration) | |
---|---|
Public Shared Function Acquire( _ ByVal lck As ILockStrategy, _ ByVal timeout As Integer _ ) As ReadLock |
C# | |
---|---|
public static ReadLock Acquire( ILockStrategy lck, int timeout ) |
Parameters
- lck
- timeout
Exception | Description |
---|---|
System.TimeoutException | The exception that is thrown when the time allotted for a process or operation has expired. |
Library/Library.Test/LockingTests/TestLockingStructs.cs
C# | Copy Code |
---|---|
using (ILockStrategy l = LockFactory.Create()) using (IDisposable r = ReadLock.Acquire(l, 0)) { r.Dispose();//since the using statement has the same boxed pointer to r, we are allowed to dispose } |
VB.NET | Copy Code |
---|---|
Using l As ILockStrategy = LockFactory.Create() Using r As IDisposable = ReadLock.Acquire(l, 0) 'since the using statement has the same boxed pointer to r, we are allowed to dispose r.Dispose() End Using End Using |
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
ReadLock StructureReadLock Members
ILockStrategy
Used By
ReadLock ReservedWriteLocking.Read()ReadLock ReservedWriteLocking.Read(Int32)
ReadLock DebugLocking.Read(Int32)
ReadLock DebugLocking.Read()
ReadLock ExclusiveLocking.Read()
ReadLock ExclusiveLocking.Read(Int32)
ReadLock ReaderWriterLocking.Read()
ReadLock ReaderWriterLocking.Read(Int32)
ReadLock SimpleReadWriteLocking.Read()
ReadLock SimpleReadWriteLocking.Read(Int32)
ReadLock WriterOnlyLocking.Read()
ReadLock WriterOnlyLocking.Read(Int32)