mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 16:22:50 +08:00
smartthreadpool: add pool option SuppressFlow and test it on main smart?? pool (may go bad)
This commit is contained in:
24
ThirdParty/SmartThreadPool/SmartThreadPool.cs
vendored
24
ThirdParty/SmartThreadPool/SmartThreadPool.cs
vendored
@@ -608,12 +608,24 @@ namespace Amib.Threading
|
||||
}
|
||||
|
||||
// Create a new thread
|
||||
|
||||
Thread workerThread =
|
||||
_stpStartInfo.MaxStackSize.HasValue
|
||||
? new Thread(ProcessQueuedItems, _stpStartInfo.MaxStackSize.Value)
|
||||
: new Thread(ProcessQueuedItems);
|
||||
|
||||
Thread workerThread;
|
||||
if(_stpStartInfo.SuppressFlow)
|
||||
{
|
||||
using(ExecutionContext.SuppressFlow())
|
||||
{
|
||||
workerThread =
|
||||
_stpStartInfo.MaxStackSize.HasValue
|
||||
? new Thread(ProcessQueuedItems, _stpStartInfo.MaxStackSize.Value)
|
||||
: new Thread(ProcessQueuedItems);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
workerThread =
|
||||
_stpStartInfo.MaxStackSize.HasValue
|
||||
? new Thread(ProcessQueuedItems, _stpStartInfo.MaxStackSize.Value)
|
||||
: new Thread(ProcessQueuedItems);
|
||||
}
|
||||
// Configure the new thread and start it
|
||||
workerThread.IsBackground = _stpStartInfo.AreThreadsBackground;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user