Skip to content

Commit ddd44f2

Browse files
authored
Include in WaitingWriteCount the thread that may be waiting in upgradable mode (#113982)
1 parent 129820a commit ddd44f2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libraries/System.Private.CoreLib/src/System/Threading/ReaderWriterLockSlim.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1412,7 +1412,8 @@ public int RecursiveWriteCount
14121412

14131413
public int WaitingUpgradeCount => (int)_numUpgradeWaiters;
14141414

1415-
public int WaitingWriteCount => (int)_numWriteWaiters;
1415+
// Include the thread that may be waiting in upgradable mode.
1416+
public int WaitingWriteCount => (int)_numWriteWaiters + (int)_numWriteUpgradeWaiters;
14161417

14171418
private struct SpinLock
14181419
{

0 commit comments

Comments
 (0)