smartthreadpool: place a global throttle on threads creation if pool as less than min number of threads ( 20/s versus .net 1/s in all cases)

This commit is contained in:
UbitUmarov
2021-01-02 12:38:25 +00:00
parent 4b7502c1dc
commit d72f19111c
2 changed files with 38 additions and 30 deletions

View File

@@ -292,14 +292,13 @@ namespace Amib.Threading.Internal
{
if (IsCanceled)
{
bool result = false;
if ((_workItemInfo.PostExecuteWorkItemCallback != null) &&
((_workItemInfo.CallToPostExecute & CallToPostExecute.WhenWorkItemCanceled) == CallToPostExecute.WhenWorkItemCanceled))
{
result = true;
return true;
}
return result;
return false;
}
Debug.Assert(WorkItemState.InQueue == GetWorkItemState());