Author: ningjiang
Date: Wed Oct 13 07:53:09 2010
New Revision: 1022017
URL: http://svn.apache.org/viewvc?rev=1022017&view=rev
Log:
CAMEL-3220 try to fix the test hang of ThreadsZeroInCoreAndMaxPoolTest
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java?rev=1022017&r1=1022016&r2=1022017&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/impl/DefaultExecutorServiceStrategy.java
Wed Oct 13 07:53:09 2010
@@ -269,7 +269,13 @@ public class DefaultExecutorServiceStrat
// the thread name must not be null
ObjectHelper.notNull(name, "ThreadName");
-
+
+ // If we set the corePoolSize to be 0, the whole camel application
will hang in JDK5
+ // just add a check here to set the corePoolSize to be 1
+ if (corePoolSize == 0) {
+ corePoolSize = 1;
+ }
+
ExecutorService answer =
ExecutorServiceHelper.newThreadPool(threadNamePattern, name, corePoolSize,
maxPoolSize, keepAliveTime,
timeUnit,
maxQueueSize, rejectedExecutionHandler, daemon);
onThreadPoolCreated(answer);