Writer nesting limit for newly created locks
Syntax
Visual Basic (Declaration) | |
---|
Public Property LimitNestedWriters As Integer |
C# | |
---|
public int LimitNestedWriters {get; set;} |
Example
Library/Library.Test/LockingTests/TestDebugLocking.cs
C# | Copy Code |
---|
DebugLockFactory<SimpleReadWriteLocking> factory = new DebugLockFactory<SimpleReadWriteLocking>(
true, -1, 1, true, 1);
Assert.AreEqual(true, factory.CaptureStack);
factory.CaptureStack = false;
Assert.AreEqual(false, factory.CaptureStack);
Assert.AreEqual(true, factory.ConcurrentReads);
factory.ConcurrentReads = false;
Assert.AreEqual(false, factory.ConcurrentReads);
Assert.AreEqual(-1, factory.LimitTimeout);
factory.LimitTimeout = 1000;
Assert.AreEqual(1000, factory.LimitTimeout);
Assert.AreEqual(1, factory.LimitNestedReaders);
factory.LimitNestedReaders = 10;
Assert.AreEqual(10, factory.LimitNestedReaders);
Assert.AreEqual(1, factory.LimitNestedWriters);
factory.LimitNestedWriters = 5;
Assert.AreEqual(5, factory.LimitNestedWriters); |
VB.NET | Copy Code |
---|
Dim factory As New DebugLockFactory(Of SimpleReadWriteLocking)(True, -1, 1, True, 1)
Assert.AreEqual(True, factory.CaptureStack)
factory.CaptureStack = False
Assert.AreEqual(False, factory.CaptureStack)
Assert.AreEqual(True, factory.ConcurrentReads)
factory.ConcurrentReads = False
Assert.AreEqual(False, factory.ConcurrentReads)
Assert.AreEqual(-1, factory.LimitTimeout)
factory.LimitTimeout = 1000
Assert.AreEqual(1000, factory.LimitTimeout)
Assert.AreEqual(1, factory.LimitNestedReaders)
factory.LimitNestedReaders = 10
Assert.AreEqual(10, factory.LimitNestedReaders)
Assert.AreEqual(1, factory.LimitNestedWriters)
factory.LimitNestedWriters = 5
Assert.AreEqual(5, factory.LimitNestedWriters) |
Requirements
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
See Also