summaryrefslogtreecommitdiff
path: root/csharp/src/Ice/ThreadPool.cs
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2017-05-04 18:57:41 +0200
committerJose <jose@zeroc.com>2017-05-04 18:57:41 +0200
commit7fd2631fd3ddaf794e997e55f74efe8d12679bb6 (patch)
treedc02e82cd7ebf99bc4ceabb746bfae83402cc1ce /csharp/src/Ice/ThreadPool.cs
parentRemoved optional semicolons after braces (diff)
downloadice-7fd2631fd3ddaf794e997e55f74efe8d12679bb6.tar.bz2
ice-7fd2631fd3ddaf794e997e55f74efe8d12679bb6.tar.xz
ice-7fd2631fd3ddaf794e997e55f74efe8d12679bb6.zip
Fixes ice_scheduler/ice_executor:
- ice_scheduler always honors the TaskContinuationOptions.ExecuteSynchronously. - ice_executor always queue the continuation with the Ice thread pool
Diffstat (limited to 'csharp/src/Ice/ThreadPool.cs')
-rw-r--r--csharp/src/Ice/ThreadPool.cs11
1 files changed, 4 insertions, 7 deletions
diff --git a/csharp/src/Ice/ThreadPool.cs b/csharp/src/Ice/ThreadPool.cs
index 4d466590988..ba46dd08df4 100644
--- a/csharp/src/Ice/ThreadPool.cs
+++ b/csharp/src/Ice/ThreadPool.cs
@@ -12,6 +12,7 @@ namespace IceInternal
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
+ using System.Threading.Tasks;
public delegate void ThreadPoolWorkItem();
public delegate void AsyncCallback(object state);
@@ -493,13 +494,10 @@ namespace IceInternal
protected sealed override bool TryExecuteTaskInline(System.Threading.Tasks.Task task, bool taskWasPreviouslyQueued)
{
- if(_dispatcher == null && !taskWasPreviouslyQueued)
+ if(!taskWasPreviouslyQueued)
{
- if(_threads.Find(t => t.getThread().ManagedThreadId.Equals(Thread.CurrentThread.ManagedThreadId)) != null)
- {
- dispatchFromThisThread(() => { TryExecuteTask(task); }, null);
- return true;
- }
+ dispatchFromThisThread(() => { TryExecuteTask(task); }, null);
+ return true;
}
return false;
}
@@ -912,5 +910,4 @@ namespace IceInternal
private Queue<ThreadPoolWorkItem> _workItems;
}
-
}