File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change 47
47
[java.net URL]
48
48
[java.util.logging Level]
49
49
[java.util List Random]
50
- [java.util.concurrent TimeUnit LinkedBlockingDeque]
50
+ [java.util.concurrent
51
+ TimeUnit LinkedBlockingDeque Executors CountDownLatch]
51
52
[com.google.javascript.jscomp CompilerOptions CompilationLevel
52
53
CompilerOptions$LanguageMode SourceMap$Format
53
54
SourceMap$DetailLevel ClosureCodingConvention SourceFile
771
772
(let [deque (LinkedBlockingDeque. inputs)
772
773
input-set (atom (into #{} (comp (remove nil?) (map :ns )) inputs))
773
774
cnt (+ 2 (.. Runtime getRuntime availableProcessors))
774
- agents (repeatedly cnt
775
- #(agent nil
776
- :error-handler
777
- (fn [err]
778
- (util/debug-prn err))))
775
+ latch (CountDownLatch. cnt)
776
+ es (Executors/newFixedThreadPool cnt)
779
777
compiled (atom [])
780
778
failed (atom false )]
781
- (doseq [agent agents ]
782
- (send agent
783
- (fn [agent ]
779
+ (dotimes [_ cnt ]
780
+ (.execute es
781
+ (bound- fn []
784
782
(compile-task deque input-set compiled opts failed)
785
- agent)))
786
- (util/measure compiler-stats
787
- " Compile sources" (apply await agents))
783
+ (.countDown latch))))
784
+ (util/measure compiler-stats " Compile sources" (.await latch))
788
785
@compiled))
789
786
790
787
(defn compile-sources
You can’t perform that action at this time.
0 commit comments