aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/ThirdParty/SmartThreadPool/SmartThreadPool.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ThirdParty/SmartThreadPool/SmartThreadPool.cs13
1 files changed, 5 insertions, 8 deletions
diff --git a/ThirdParty/SmartThreadPool/SmartThreadPool.cs b/ThirdParty/SmartThreadPool/SmartThreadPool.cs
index 19a0007..2c061d7 100644
--- a/ThirdParty/SmartThreadPool/SmartThreadPool.cs
+++ b/ThirdParty/SmartThreadPool/SmartThreadPool.cs
@@ -541,17 +541,10 @@ namespace Amib.Threading
541 // Process until shutdown. 541 // Process until shutdown.
542 while(!_shutdown) 542 while(!_shutdown)
543 { 543 {
544 // Update the last time this thread was seen alive. 544
545 // It's good for debugging.
546 _workerThreads[Thread.CurrentThread] = DateTime.Now;
547
548 // Wait for a work item, shutdown, or timeout 545 // Wait for a work item, shutdown, or timeout
549 WorkItem workItem = Dequeue(); 546 WorkItem workItem = Dequeue();
550 547
551 // Update the last time this thread was seen alive.
552 // It's good for debugging.
553 _workerThreads[Thread.CurrentThread] = DateTime.Now;
554
555 // On timeout or shut down. 548 // On timeout or shut down.
556 if (null == workItem) 549 if (null == workItem)
557 { 550 {
@@ -560,6 +553,10 @@ namespace Amib.Threading
560 { 553 {
561 lock(_workerThreads.SyncRoot) 554 lock(_workerThreads.SyncRoot)
562 { 555 {
556 // Update the last time this thread was seen alive.
557 // It's good for debugging.
558 _workerThreads[Thread.CurrentThread] = DateTime.Now;
559
563 if (_workerThreads.Count > _stpStartInfo.MinWorkerThreads) 560 if (_workerThreads.Count > _stpStartInfo.MinWorkerThreads)
564 { 561 {
565 // Inform that the thread is quiting and then quit. 562 // Inform that the thread is quiting and then quit.