diff options
Diffstat (limited to 'csharp/src')
-rw-r--r-- | csharp/src/Ice/ThreadPool.cs | 11 |
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; } - } |