smartThreadPool changes

This commit is contained in:
UbitUmarov
2022-10-02 12:03:44 +01:00
parent eeacd39d25
commit 2346af0715
4 changed files with 12 additions and 567 deletions

View File

@@ -427,12 +427,11 @@ namespace Amib.Threading.Internal
// If we got a ThreadAbortException and the STP is not shutting down, it means the
// work items was cancelled.
tae.GetHashCode();
if (!SmartThreadPool.CurrentThreadEntry.AssociatedSmartThreadPool.IsShuttingdown)
{
Thread.ResetAbort();
}
//if (!SmartThreadPool.CurrentThreadEntry.AssociatedSmartThreadPool.IsShuttingdown)
//{
// Thread.ResetAbort();
//}
}
if (!SmartThreadPool.IsWorkItemCanceled)
{
SetResult(result, exception);
@@ -728,7 +727,7 @@ namespace Amib.Threading.Internal
Thread executionThread = Interlocked.CompareExchange(ref _executingThread, null, _executingThread);
if (null != executionThread)
{
executionThread.Abort(); // "Cancel"
//executionThread.Abort(); // "Cancel"
// No need to signalComplete, because we already cancelled this work item
// so it already signaled its completion.
//signalComplete = true;
@@ -745,7 +744,7 @@ namespace Amib.Threading.Internal
Thread executionThread = Interlocked.CompareExchange(ref _executingThread, null, _executingThread);
if (null != executionThread)
{
executionThread.Abort(); // "Cancel"
//executionThread.Abort(); // "Cancel"
success = true;
signalComplete = true;
}