diff --git a/engine/src/core/com/jme3/asset/ThreadingManager.java b/engine/src/core/com/jme3/asset/ThreadingManager.java
index 6ed2c742e..26cac5fcd 100644
--- a/engine/src/core/com/jme3/asset/ThreadingManager.java
+++ b/engine/src/core/com/jme3/asset/ThreadingManager.java
@@ -32,10 +32,7 @@
package com.jme3.asset;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.*;
/**
* ThreadingManager
manages the threads used to load content
@@ -46,11 +43,10 @@ import java.util.concurrent.ThreadFactory;
public class ThreadingManager {
protected final ExecutorService executor =
- Executors.newFixedThreadPool(2,
+ Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors(),
new LoadingThreadFactory());
protected final AssetManager owner;
-
protected int nextThreadId = 0;
public ThreadingManager(AssetManager owner){
@@ -59,44 +55,32 @@ public class ThreadingManager {
protected class LoadingThreadFactory implements ThreadFactory {
public Thread newThread(Runnable r) {
- Thread t = new Thread(r, "pool" + (nextThreadId++));
+ Thread t = new Thread(r, "jME3-threadpool-" + (nextThreadId++));
t.setDaemon(true);
t.setPriority(Thread.MIN_PRIORITY);
return t;
}
}
- protected class LoadingTask implements Callable