Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Commit 849ff20

Browse files
committed
Use object.ReferenceEquals when comparing Actions in SocketInput
1 parent 2ce28d8 commit 849ff20

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Microsoft.AspNet.Server.Kestrel/Http/SocketInput.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public SocketInput(MemoryPool2 memory, IThreadPool threadPool)
3636

3737
public bool RemoteIntakeFin { get; set; }
3838

39-
public bool IsCompleted => (_awaitableState == _awaitableIsCompleted);
39+
public bool IsCompleted => ReferenceEquals(_awaitableState, _awaitableIsCompleted);
4040

4141
public MemoryPoolBlock2 IncomingStart()
4242
{
@@ -124,8 +124,8 @@ private void Complete()
124124

125125
_manualResetEvent.Set();
126126

127-
if (awaitableState != _awaitableIsCompleted &&
128-
awaitableState != _awaitableIsNotCompleted)
127+
if (!ReferenceEquals(awaitableState, _awaitableIsCompleted) &&
128+
!ReferenceEquals(awaitableState, _awaitableIsNotCompleted))
129129
{
130130
_threadPool.Run(awaitableState);
131131
}
@@ -201,11 +201,11 @@ public void OnCompleted(Action continuation)
201201
continuation,
202202
_awaitableIsNotCompleted);
203203

204-
if (awaitableState == _awaitableIsNotCompleted)
204+
if (ReferenceEquals(awaitableState, _awaitableIsNotCompleted))
205205
{
206206
return;
207207
}
208-
else if (awaitableState == _awaitableIsCompleted)
208+
else if (ReferenceEquals(awaitableState, _awaitableIsCompleted))
209209
{
210210
_threadPool.Run(continuation);
211211
}

0 commit comments

Comments
 (0)