Skip to content

Commit

Permalink
Fix crashing InMemory.FunctionalTests (#59821)
Browse files Browse the repository at this point in the history
  • Loading branch information
BrennanConroy authored Jan 13, 2025
1 parent b2d50f7 commit 151d09e
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,11 @@ public override void Abort(ConnectionAbortedException abortReason)

public void OnClosed()
{
if (_isClosed)
if (Interlocked.CompareExchange(ref _isClosed, true, false) == true)
{
return;
}

_isClosed = true;

ThreadPool.UnsafeQueueUserWorkItem(state =>
{
state._connectionClosedTokenSource.Cancel();
Expand Down

0 comments on commit 151d09e

Please sign in to comment.