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

Commit

Permalink
Task.Run -> ThreadPool.QueueUserWorkItem
Browse files Browse the repository at this point in the history
Task.Run eventually ends up being QueueUserWorkItem.
The returned task is ignored, so no added goodness.
Short running item.

Cut out the middleman
  • Loading branch information
benaadams committed Nov 10, 2015
1 parent facf3ad commit a2c4e3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Microsoft.AspNet.Server.Kestrel/Http/SocketInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void IncomingComplete(int count, Exception error)
if (awaitableState != _awaitableIsCompleted &&
awaitableState != _awaitableIsNotCompleted)
{
Task.Run(awaitableState);
ThreadPool.QueueUserWorkItem((o) => ((Action)o)(), awaitableState);
}
}

Expand Down Expand Up @@ -194,7 +194,7 @@ public void OnCompleted(Action continuation)
}
else if (awaitableState == _awaitableIsCompleted)
{
Task.Run(continuation);
ThreadPool.QueueUserWorkItem((o) => ((Action)o)(), continuation);
}
else
{
Expand Down

0 comments on commit a2c4e3a

Please sign in to comment.