Skip to content

Commit a047476

Browse files
committed
redux of runtime parking op var conditional
1 parent d56082d commit a047476

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/clojure/clojure/core/async.clj

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,16 +165,16 @@ IOC and vthread code.
165165
(timers/timeout msecs))
166166

167167
(defn- defparkingop-helper [op doc arglist body]
168-
(let [as (mapv #(list 'quote %) arglist)]
169-
(list `def (with-meta op {:arglists `(list ~as) :doc doc})
170-
(if dispatch/vthreads-available-and-allowed?
171-
(let [blockingop (-> op name (str "!") symbol)]
172-
`(fn [~'& ~'args] ~(list* apply blockingop '[args])))
173-
`(fn ~arglist ~@body)))))
168+
(let [as (mapv #(list 'quote %) arglist)
169+
blockingop (-> op name (str "!") symbol)]
170+
`(def ~(with-meta op {:arglists `(list ~as) :doc doc})
171+
(if dispatch/vthreads-available-and-allowed?
172+
(fn [~'& ~'args] ~(list* apply blockingop '[args]))
173+
(fn ~arglist ~@body)))))
174174

175175
(defmacro defparkingop
176-
"Emits either parking op or reimplement as blocking op when vthreads
177-
available."
176+
"Emits a Var definition that initializes as a parking op or as a
177+
blocking op when vthreads available and allowed."
178178
[op doc arglist & body]
179179
(defparkingop-helper op doc arglist body))
180180

0 commit comments

Comments
 (0)