summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2007-12-03 20:26:24 +0000
committerRich Hickey <richhickey@gmail.com>2007-12-03 20:26:24 +0000
commit78a8b5b34276cdffed7498edab4c8ae6cfbdaa83 (patch)
treebd131ead85c1ac8727d00ad65ee6878b599f1b0e
parent0822f76b347fa29643ad8de5f4b5e15434145fab (diff)
made executor public
-rw-r--r--src/jvm/clojure/lang/Agent.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/jvm/clojure/lang/Agent.java b/src/jvm/clojure/lang/Agent.java
index bbabb701..b8d001f7 100644
--- a/src/jvm/clojure/lang/Agent.java
+++ b/src/jvm/clojure/lang/Agent.java
@@ -14,8 +14,7 @@ package clojure.lang;
import java.util.Queue;
import java.util.LinkedList;
-import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
+import java.util.concurrent.*;
public class Agent implements IRef{
volatile Object state;
@@ -24,7 +23,12 @@ boolean busy = false;
volatile ISeq errors = null;
//todo - make tuneable
-final static Executor executor = Executors.newFixedThreadPool(2 * Runtime.getRuntime().availableProcessors());
+final public static ThreadPoolExecutor executor =
+ new ThreadPoolExecutor(2 * Runtime.getRuntime().availableProcessors(),
+ 2 * Runtime.getRuntime().availableProcessors(),
+ 0L, TimeUnit.MILLISECONDS,
+ new LinkedBlockingQueue<Runnable>());
+//Executors.newFixedThreadPool(2 * Runtime.getRuntime().availableProcessors());
//final static Executor executor = Executors.newCachedThreadPool();
final static ThreadLocal<PersistentVector> nested = new ThreadLocal<PersistentVector>();