* 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:
John Hurliman
2009-10-22 01:30:12 -07:00
parent 1e71e3f910
commit 2f394b7e7e
4 changed files with 27 additions and 12 deletions

View File

@@ -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;