Skip to content

Commit 36499e4

Browse files
committed
Add test for issue #18
1 parent 5624a75 commit 36499e4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

UnitTests/ReentracePermittedTests.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,25 @@ public async Task NestedFunctionCallReentrance()
5151
await NestedFunctionAsync();
5252
}
5353
}
54+
55+
// Issue #18
56+
[TestMethod]
57+
//[Timeout(5)]
58+
public async Task BackToBackReentrance()
59+
{
60+
var asyncLock = new AsyncLock();
61+
async Task InnerFunctionAsync()
62+
{
63+
using (await asyncLock.LockAsync())
64+
{
65+
//
66+
}
67+
}
68+
using (await asyncLock.LockAsync())
69+
{
70+
await InnerFunctionAsync();
71+
await InnerFunctionAsync();
72+
}
73+
}
5474
}
5575
}

0 commit comments

Comments
 (0)