From 2152a7c12224c1545a5ee4375f097cf67d78609f Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Wed, 6 Jun 2012 12:07:18 +0000 Subject: [PATCH] Explicitly create the writerThread to be an executor with an unbounded linked blocking queue. I have sometimes seen rejected exceptions (which should never happen) using the Executors.newSingleThreadExecutor which makes me doubt the documentation. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@760 180e2498-e6e9-4542-8430-84ac67f01cd8 --- .../ConcurrentLoadingThrustCurveMotorSetDatabase.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/net/sf/openrocket/startup/ConcurrentLoadingThrustCurveMotorSetDatabase.java b/core/src/net/sf/openrocket/startup/ConcurrentLoadingThrustCurveMotorSetDatabase.java index 0a12605b..a546f739 100644 --- a/core/src/net/sf/openrocket/startup/ConcurrentLoadingThrustCurveMotorSetDatabase.java +++ b/core/src/net/sf/openrocket/startup/ConcurrentLoadingThrustCurveMotorSetDatabase.java @@ -5,7 +5,6 @@ import java.io.IOException; import java.io.InputStream; import java.util.List; import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadPoolExecutor; @@ -124,7 +123,9 @@ public class ConcurrentLoadingThrustCurveMotorSetDatabase extends ThrustCurveMot private BookKeeping() { - writerThread = Executors.newSingleThreadExecutor( new ThreadFactory() { + writerThread = new ThreadPoolExecutor(1,1,200, TimeUnit.SECONDS, + new LinkedBlockingQueue(), + new ThreadFactory() { @Override public Thread newThread(Runnable r) { Thread t = new Thread(r,"MotorWriterThread"); -- 2.47.2