File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 2626
2727 <!-- Compiles the java code (including the usage of library for JUnit -->
2828 <target name =" compile" depends =" makedir" >
29- <javac srcdir =" ${ src.dir } " destdir =" ${ build.dir } " classpath =" ${ lib.dir } /commons-pool-1.6.jar:${ lib.dir } /commons-lang-2.6.jar:${ lib.dir } /ws-commons-util-1.0.1.jar:${ lib.dir } /en_us.jar:${ lib.dir } /commons-digester-1.8.1.jar:${ lib.dir } /commons-logging-1.1.2.jar:${ lib.dir } /commons-io-2.4.jar:${ lib.dir } /RosBase.jar:${ lib.dir } /commons-net-1.4.1.jar:${ lib.dir } /RosMsgs.jar" >
29+ <javac compiler = " modern " srcdir =" ${ src.dir } " destdir =" ${ build.dir } " classpath =" ${ lib.dir } /commons-pool-1.6.jar:${ lib.dir } /commons-lang-2.6.jar:${ lib.dir } /ws-commons-util-1.0.1.jar:${ lib.dir } /en_us.jar:${ lib.dir } /commons-digester-1.8.1.jar:${ lib.dir } /commons-logging-1.1.2.jar:${ lib.dir } /commons-io-2.4.jar:${ lib.dir } /RosBase.jar:${ lib.dir } /commons-net-1.4.1.jar:${ lib.dir } /RosMsgs.jar" >
3030 </javac >
3131
3232 </target >
Original file line number Diff line number Diff line change 1313import org .apache .commons .logging .Log ;
1414import org .apache .commons .logging .LogFactory ;
1515
16-
1716/**
1817 * Class to manage thread resources throughout the application. Singleton
1918 * Usage pattern is ThreadPoolManager.getInstance().spin([your Runnable])
2726 */
2827public class ThreadPoolManager {
2928 private static final boolean DEBUG = false ;
30- private static final Log log = LogFactory .getLog (ThreadPoolManager .class );
29+ private static final Log log = LogFactory .getLog (ThreadPoolManager .class );
3130 private static String DEFAULT_THREAD_POOL = "RPCSERVER" ;
3231 private int threadNum = 0 ;
3332 private static Map <String , ExecutorService > executor = new HashMap <String , ExecutorService >();// = Executors.newCachedThreadPool(dtf);
3433
35- public static ThreadPoolManager threadPoolManager = null ;
34+ public static volatile ThreadPoolManager threadPoolManager = null ;
3635 private ThreadPoolManager () { }
3736
3837 public static ThreadPoolManager getInstance () {
3938 if ( threadPoolManager == null ) {
40- threadPoolManager = new ThreadPoolManager ();
39+ synchronized (ThreadPoolManager .class ) {
40+ if (threadPoolManager == null ) {
41+ threadPoolManager = new ThreadPoolManager ();
42+ }
43+ }
4144 // set up pool for system processes
4245 executor .put (DEFAULT_THREAD_POOL , Executors .newCachedThreadPool (getInstance ().new LocalThreadFactory (DEFAULT_THREAD_POOL )));
4346 }
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public class OutgoingMessageQueue<T> {
3333 private static final boolean DEBUG = false ;
3434 private static final Log log = LogFactory .getLog (OutgoingMessageQueue .class );
3535
36- private static final int DEQUE_CAPACITY = 8192 ;
36+ private static final int DEQUE_CAPACITY = 256 ;
3737
3838 private final CircularBlockingDeque <T > deque ;
3939 private final Writer writer ;
You can’t perform that action at this time.
0 commit comments