Skip to content

Commit 151d09e

Browse files
Fix crashing InMemory.FunctionalTests (#59821)
1 parent b2d50f7 commit 151d09e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Diff for: src/Servers/Kestrel/test/InMemory.FunctionalTests/TestTransport/InMemoryTransportConnection.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,11 @@ public override void Abort(ConnectionAbortedException abortReason)
6363

6464
public void OnClosed()
6565
{
66-
if (_isClosed)
66+
if (Interlocked.CompareExchange(ref _isClosed, true, false) == true)
6767
{
6868
return;
6969
}
7070

71-
_isClosed = true;
72-
7371
ThreadPool.UnsafeQueueUserWorkItem(state =>
7472
{
7573
state._connectionClosedTokenSource.Cancel();

0 commit comments

Comments
 (0)