Skip to content

Commit

Permalink
made futures use CachedThreadPool
Browse files Browse the repository at this point in the history
  • Loading branch information
richhickey committed Mar 1, 2009
1 parent 2fd3186 commit 115bbb2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/clj/clojure/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -3998,7 +3998,7 @@
return it on all subsequent calls to deref/@. If the computation has
not yet finished, calls to deref/@ will block."
[#^Callable f]
(let [fut (.submit clojure.lang.Agent/pooledExecutor f)]
(let [fut (.submit clojure.lang.Agent/soloExecutor f)]
(proxy [clojure.lang.IDeref java.util.concurrent.Future] []
(deref [] (.get fut))
(get ([] (.get fut))
Expand Down
2 changes: 1 addition & 1 deletion src/jvm/clojure/lang/Agent.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Agent extends ARef {
final public static ExecutorService pooledExecutor =
Executors.newFixedThreadPool(2 + Runtime.getRuntime().availableProcessors());

final static ExecutorService soloExecutor = Executors.newCachedThreadPool();
final public static ExecutorService soloExecutor = Executors.newCachedThreadPool();

final static ThreadLocal<IPersistentVector> nested = new ThreadLocal<IPersistentVector>();

Expand Down

0 comments on commit 115bbb2

Please sign in to comment.