Update Multiprocessor.cs

pull/1/head
Ogoun 5 years ago
parent b3827ad830
commit dcdb71f121

@ -72,18 +72,28 @@ namespace ZeroLevel.Utils
public void Dispose() public void Dispose()
{ {
_is_disposed = true; _is_disposed = true;
try
{
_queue.CompleteAdding(); _queue.CompleteAdding();
Thread.Yield();
_queue.Dispose(); _queue.Dispose();
foreach (var thread in _threads) foreach (var thread in _threads)
{ {
try try
{ {
thread.Join();
thread.Abort(); thread.Abort();
} }
catch { } catch { }
} }
foreach (var thread in _threads)
{
try
{
thread.Join();
}
catch { }
}
}
catch { }
} }
} }
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.