File tree Expand file tree Collapse file tree 2 files changed +4
-20
lines changed
src/main/clojure/clojure/core Expand file tree Collapse file tree 2 files changed +4
-20
lines changed Original file line number Diff line number Diff line change 99(ns clojure.core.async
1010 " Facilities for async programming and communication.
1111
12- go blocks are dispatched over an internal thread pool, which
13- defaults to 8 threads. The size of this pool can be modified using
14- the Java system property `clojure.core.async.pool-size`.
15-
1612Set Java system property `clojure.core.async.go-checking` to true
1713to validate go blocks do not invoke core.async blocking operations.
1814Property is read once, at namespace load time. Recommended for use
@@ -58,9 +54,8 @@ return nil for unexpected contexts."
5854 )
5955 (:import [java.util.concurrent.atomic AtomicLong]
6056 [java.util.concurrent.locks Lock]
61- [java.util.concurrent Executors Executor ThreadLocalRandom]
62- [java.util Arrays ArrayList]
63- [clojure.lang Var]))
57+ [java.util.concurrent ThreadLocalRandom]
58+ [java.util Arrays ArrayList]))
6459
6560(alias 'core 'clojure.core)
6661
Original file line number Diff line number Diff line change 88
99(ns ^{:skip-wiki true }
1010 clojure.core.async.impl.dispatch
11- (:require [clojure.core.async.impl.protocols :as impl])
1211 (:import [java.util.concurrent Executors ExecutorService ThreadFactory]))
1312
1413(set! *warn-on-reflection* true )
3635 (.setName (format name-format (swap! counter inc)))
3736 (.setDaemon daemon))))))))
3837
39- (defonce
40- ^{:doc " Number of processors reported by the JVM" }
41- processors (.availableProcessors (Runtime/getRuntime )))
42-
43- (def ^:private pool-size
44- " Value is set via clojure.core.async.pool-size system property; defaults to 8; uses a
45- delay so property can be set from code after core.async namespace is loaded but before
46- any use of the async thread pool."
47- (delay (or (Long/getLong " clojure.core.async.pool-size" ) 8 )))
48-
4938; ; used only for implementing go-checking
5039(def ^:private ^:dynamic *in-go-dispatch* false )
5140
6958 nil )
7059
7160(defn- make-ctp-named
72- [workflow ]
73- (Executors/newCachedThreadPool (counted-thread-factory (str " async-" (name workflow ) " -%d" ) true )))
61+ [workload ]
62+ (Executors/newCachedThreadPool (counted-thread-factory (str " async-" (name workload ) " -%d" ) true )))
7463
7564(defn ^:private create-default-executor
7665 [workload]
You can’t perform that action at this time.
0 commit comments