Skip to content

Commit 41d3c73

Browse files
author
Leon Barrett
committed
Slight readability/doc improvements
1 parent a70d88d commit 41d3c73

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/clj/com/climate/claypoole.clj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
4949
When doing a pmap, Claypoole pushes input tasks into the threadpool. It
5050
normally tries to keep the threadpool full, plus it adds a buffer of size
51-
nthreads. If it can't find out the number of thread in the threadpool, it
51+
nthreads. If it can't find out the number of threads in the threadpool, it
5252
just tries to keep *default-pmap-buffer* tasks in the pool."
5353
200)
5454

@@ -278,17 +278,17 @@
278278
`(future-call ~pool (^{:once true} fn future-body [] ~@body)))
279279

280280
(defn- make-canceller
281-
"Creates a function to cancel a bunch of futures."
282-
[future-reader]
281+
"Creates a function to cancel a pmap."
282+
[driver]
283283
(let [first-already-cancelled (atom Long/MAX_VALUE)]
284284
(fn [i later-tasks]
285285
(let [cancel-end @first-already-cancelled]
286286
;; Don't re-kill futures we've already zapped to prevent an O(n^2)
287287
;; explosion.
288288
(when (< i cancel-end)
289289
(swap! first-already-cancelled min i)
290-
;; Kill the future reader.
291-
(future-cancel future-reader)
290+
;; Kill the pmap driver thread.
291+
(future-cancel driver)
292292
;; Stop the tasks above i before cancel-end.
293293
(doseq [f (->> later-tasks rest (take (- cancel-end i)))]
294294
(future-cancel f)))))))

src/clj/com/climate/claypoole/impl.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,8 @@
229229
nil))
230230

231231
;; Queue-seq needs a unique item that, when seen in a queue, indicates that the
232-
;; sequence has ended. It uses this private object, and uses identical? to
233-
;; check against this object's (unique) memory address.
232+
;; sequence has ended. It uses the private object end-marker, and uses
233+
;; identical? to check against this object's (unique) memory address.
234234
(let [end-marker (Object.)]
235235

236236
(defn- queue-reader

0 commit comments

Comments
 (0)