From 2f394b7e7ebf991c7a70f93bf251d26d8043aaa2 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 22 Oct 2009 01:30:12 -0700 Subject: * 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." --- ThirdParty/SmartThreadPool/SmartThreadPool.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ThirdParty') diff --git a/ThirdParty/SmartThreadPool/SmartThreadPool.cs b/ThirdParty/SmartThreadPool/SmartThreadPool.cs index c21984e..bd52f62 100644 --- a/ThirdParty/SmartThreadPool/SmartThreadPool.cs +++ b/ThirdParty/SmartThreadPool/SmartThreadPool.cs @@ -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; -- cgit v1.1