summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2023-02-17 15:26:24 +0100
committerSimon Rettberg2023-02-17 15:26:24 +0100
commit405bbd9d90b51764c3fe42bead214b022be6cd2a (patch)
treea32ea1098aed11bf568bcb71bf111ecb9283049a
parentNanoHTTPD: Add constructor to easily set thread limit and queue len (diff)
downloadmaster-sync-shared-405bbd9d90b51764c3fe42bead214b022be6cd2a.tar.gz
master-sync-shared-405bbd9d90b51764c3fe42bead214b022be6cd2a.tar.xz
master-sync-shared-405bbd9d90b51764c3fe42bead214b022be6cd2a.zip
NanoHTTPD: Switch back to growing thread pool
-rw-r--r--src/main/java/fi/iki/elonen/NanoHTTPD.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/fi/iki/elonen/NanoHTTPD.java b/src/main/java/fi/iki/elonen/NanoHTTPD.java
index d3582fa..1795624 100644
--- a/src/main/java/fi/iki/elonen/NanoHTTPD.java
+++ b/src/main/java/fi/iki/elonen/NanoHTTPD.java
@@ -63,10 +63,10 @@ import java.util.StringTokenizer;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.RejectedExecutionException;
-import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.apache.commons.io.output.ByteArrayOutputStream;
+import org.openslx.util.GrowingThreadPoolExecutor;
import org.openslx.util.PrioThreadFactory;
import org.openslx.util.Util;
@@ -178,8 +178,8 @@ public abstract class NanoHTTPD implements Runnable
*/
public NanoHTTPD( String hostname, int port, int maxThreads, int maxQueue ) throws IOException
{
- this( hostname, port, new ThreadPoolExecutor( 2, maxThreads, 1, TimeUnit.MINUTES,
- new ArrayBlockingQueue<Runnable>( maxQueue ), new PrioThreadFactory( "httpd", Thread.NORM_PRIORITY ) ) );
+ this( hostname, port, new GrowingThreadPoolExecutor( 2, maxThreads, 1, TimeUnit.MINUTES,
+ new ArrayBlockingQueue<Runnable>( maxQueue ), new PrioThreadFactory( "httpd" ) ) );
}
/**