summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gerrand <adg@golang.org>2011-04-27 10:12:10 +1000
committerAndrew Gerrand <adg@golang.org>2011-04-27 10:12:10 +1000
commitb3b550b10ea3877cbf22fd45bf527bc296ce395d (patch)
tree2fb39a1ba73957e3639c403b2ddfa6022a733e93
parent0f9aba630311f394219580efdbea92347430a135 (diff)
downloadgo-b3b550b10ea3877cbf22fd45bf527bc296ce395d.tar.gz
builder: build multiple targets in parallel
R=rsc, dfc CC=golang-dev http://codereview.appspot.com/4452047
-rw-r--r--misc/dashboard/builder/main.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/misc/dashboard/builder/main.go b/misc/dashboard/builder/main.go
index 3924ff2a0..d11cbb133 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