mirror of
https://github.com/opensim/opensim.git
synced 2026-07-02 08:25:44 +08:00
more changes to smartthreadpool
This commit is contained in:
16
ThirdParty/SmartThreadPool/SmartThreadPool.cs
vendored
16
ThirdParty/SmartThreadPool/SmartThreadPool.cs
vendored
@@ -676,10 +676,6 @@ namespace Amib.Threading
|
||||
// Process until shutdown.
|
||||
while (!_shutdown)
|
||||
{
|
||||
// Update the last time this thread was seen alive.
|
||||
// It's good for debugging.
|
||||
CurrentThreadEntry.IAmAlive();
|
||||
|
||||
// The following block handles the when the MaxWorkerThreads has been
|
||||
// incremented by the user at run-time.
|
||||
// Double lock for quit.
|
||||
@@ -693,18 +689,17 @@ namespace Amib.Threading
|
||||
// This method must be called within this lock or else
|
||||
// more threads will quit and the thread pool will go
|
||||
// below the lower limit.
|
||||
InformCompleted();
|
||||
//InformCompleted();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CurrentThreadEntry.IAmAlive();
|
||||
|
||||
// Wait for a work item, shutdown, or timeout
|
||||
WorkItem workItem = Dequeue();
|
||||
|
||||
// Update the last time this thread was seen alive.
|
||||
// It's good for debugging.
|
||||
CurrentThreadEntry.IAmAlive();
|
||||
|
||||
// On timeout or shut down.
|
||||
if (workItem == null)
|
||||
@@ -720,7 +715,7 @@ namespace Amib.Threading
|
||||
// This method must be called within this lock or else
|
||||
// more threads will quit and the thread pool will go
|
||||
// below the lower limit.
|
||||
InformCompleted();
|
||||
//InformCompleted();
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -728,6 +723,8 @@ namespace Amib.Threading
|
||||
continue;
|
||||
}
|
||||
|
||||
CurrentThreadEntry.IAmAlive();
|
||||
|
||||
try
|
||||
{
|
||||
// Initialize the value to false
|
||||
@@ -819,6 +816,7 @@ namespace Amib.Threading
|
||||
{
|
||||
InformCompleted();
|
||||
FireOnThreadTermination();
|
||||
_workItemsQueue.CloseThreadWaiter();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user