Skip to content

Commit

Permalink
Add minor cosmetic improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
niwinz committed Dec 3, 2023
1 parent d2ea075 commit 36dcaf5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/promesa/exec.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -332,17 +332,17 @@
thr)))))))

#?(:clj
(defn forkjoin-thread-factory
^ForkJoinPool$ForkJoinWorkerThreadFactory
[& {:keys [name daemon] :or {name "promesa/forkjoin/%s" daemon true}}]
(let [counter (AtomicLong. 0)]
(reify ForkJoinPool$ForkJoinWorkerThreadFactory
(newThread [_ pool]
(let [thread (.newThread ForkJoinPool/defaultForkJoinWorkerThreadFactory pool)
tname (format name (get-next counter))]
(.setName ^ForkJoinWorkerThread thread ^String tname)
(.setDaemon ^ForkJoinWorkerThread thread ^Boolean daemon)
thread))))))
(defn forkjoin-thread-factory
^ForkJoinPool$ForkJoinWorkerThreadFactory
[& {:keys [name daemon] :or {name "promesa/forkjoin/%s" daemon true}}]
(let [counter (AtomicLong. 0)]
(reify ForkJoinPool$ForkJoinWorkerThreadFactory
(newThread [_ pool]
(let [thread (.newThread ForkJoinPool/defaultForkJoinWorkerThreadFactory pool)
tname (format name (get-next counter))]
(.setName ^ForkJoinWorkerThread thread ^String tname)
(.setDaemon ^ForkJoinWorkerThread thread ^Boolean daemon)
thread))))))

#?(:clj
(defonce default-thread-factory
Expand Down

0 comments on commit 36dcaf5

Please sign in to comment.