* Allow SmartThreadPool to be initialized without setting max stack size (like the original implementation)
* Only initialize Util's SmartThreadPool if it is actually being used * No longer initializing Util's SmartThreadPool with a custom max stack size. From MSDN: "Avoid using this constructor overload. The default stack size used by the Thread(ThreadStart) constructor overload is the recommended stack size for threads."
This commit is contained in:
@@ -499,7 +499,11 @@ namespace Amib.Threading
|
||||
}
|
||||
|
||||
// Create a new thread
|
||||
Thread workerThread = new Thread(new ThreadStart(ProcessQueuedItems), _stpStartInfo.StackSize);
|
||||
Thread workerThread;
|
||||
if (_stpStartInfo.StackSize > 0)
|
||||
workerThread = new Thread(ProcessQueuedItems, _stpStartInfo.StackSize);
|
||||
else
|
||||
workerThread = new Thread(ProcessQueuedItems);
|
||||
|
||||
// Configure the new thread and start it
|
||||
workerThread.Name = "STP " + Name + " Thread #" + _threadCounter;
|
||||
|
||||
Reference in New Issue
Block a user