diff options
author | Andrew Gerrand <adg@golang.org> | 2011-04-27 10:12:10 +1000 |
---|---|---|
committer | Andrew Gerrand <adg@golang.org> | 2011-04-27 10:12:10 +1000 |
commit | 50e65ab30d013955ba46dc6b6c32a6181f3c53b0 (patch) | |
tree | d9e1eae50896dc5f1d5b9961887aabc8eaaf8585 | |
parent | a2014f104c47225052acd75d8b3bd265c7175235 (diff) | |
download | go-50e65ab30d013955ba46dc6b6c32a6181f3c53b0.tar.gz go-50e65ab30d013955ba46dc6b6c32a6181f3c53b0.zip |
builder: build multiple targets in parallel
R=rsc, dfc
CC=golang-dev
https://golang.org/cl/4452047
-rw-r--r-- | misc/dashboard/builder/main.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/misc/dashboard/builder/main.go b/misc/dashboard/builder/main.go index 3924ff2a00..d11cbb1337 100644 --- a/misc/dashboard/builder/main.go +++ b/misc/dashboard/builder/main.go @@ -60,6 +60,7 @@ var ( buildRevision = flag.String("rev", "", "Build specified revision and exit") buildCmd = flag.String("cmd", "./all.bash", "Build command (specify absolute or relative to go/src/)") external = flag.Bool("external", false, "Build external packages") + parallel = flag.Bool("parallel", false, "Build multiple targets in parallel") verbose = flag.Bool("v", false, "verbose") ) @@ -133,9 +134,19 @@ func main() { continue } built := false - for _, b := range builders { - if b.build() { - built = true + if *parallel { + done := make(chan bool) + for _, b := range builders { + go func(b *Builder) { + done <- b.build() + }(b) + } + for _ = range builders { + built = <-done || built + } + } else { + for _, b := range builders { + built = b.build() || built } } // only run benchmarks if we didn't build anything |