forked from External/mage
playertype, enum singleton
This commit is contained in:
parent
b19170f34f
commit
211d433ea9
50 changed files with 642 additions and 675 deletions
|
|
@ -38,8 +38,8 @@ import java.util.concurrent.TimeUnit;
|
|||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
public class ThreadExecutor {
|
||||
|
||||
public enum ThreadExecutor {
|
||||
instance;
|
||||
private static final ExecutorService callExecutor = Executors.newCachedThreadPool();
|
||||
private static final ExecutorService userExecutor = Executors.newCachedThreadPool();
|
||||
private static final ExecutorService gameExecutor = Executors.newFixedThreadPool(ConfigSettings.instance.getMaxGameThreads());
|
||||
|
|
@ -74,14 +74,6 @@ public class ThreadExecutor {
|
|||
((ThreadPoolExecutor) timeoutIdleExecutor).setThreadFactory(new XMageThreadFactory("TIMEOUT_IDLE"));
|
||||
}
|
||||
|
||||
private static final ThreadExecutor INSTANCE = new ThreadExecutor();
|
||||
|
||||
public static ThreadExecutor getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
private ThreadExecutor() {
|
||||
}
|
||||
|
||||
public int getActiveThreads(ExecutorService executerService) {
|
||||
if (executerService instanceof ThreadPoolExecutor) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue