Make BottomUpMutators parallel
Append .Parallel() to all of the RegisterBottomUpMutator calls to tell
Blueprint it can run them in parallel.
Test: identical build.ninja, passes race detector
Change-Id: I969a0689522d4cba7c8ff51e2aa00fe2fd338a89
diff --git a/android/arch.go b/android/arch.go
index c767bd7..5074c4c 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -25,10 +25,10 @@
)
func init() {
- RegisterBottomUpMutator("defaults_deps", defaultsDepsMutator)
+ RegisterBottomUpMutator("defaults_deps", defaultsDepsMutator).Parallel()
RegisterTopDownMutator("defaults", defaultsMutator)
- RegisterBottomUpMutator("arch", ArchMutator)
+ RegisterBottomUpMutator("arch", ArchMutator).Parallel()
}
var (
diff --git a/android/mutator.go b/android/mutator.go
index 9405f2d..c0cb3aa 100644
--- a/android/mutator.go
+++ b/android/mutator.go
@@ -44,8 +44,8 @@
androidBaseContextImpl
}
-func RegisterBottomUpMutator(name string, mutator AndroidBottomUpMutator) {
- soong.RegisterBottomUpMutator(name, func(ctx blueprint.BottomUpMutatorContext) {
+func RegisterBottomUpMutator(name string, mutator AndroidBottomUpMutator) soong.BottomUpMutatorHandle {
+ return soong.RegisterBottomUpMutator(name, func(ctx blueprint.BottomUpMutatorContext) {
if a, ok := ctx.Module().(Module); ok {
actx := &androidBottomUpMutatorContext{
BottomUpMutatorContext: ctx,
diff --git a/android/variable.go b/android/variable.go
index d2dc5b9..531125d 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -24,7 +24,7 @@
)
func init() {
- RegisterBottomUpMutator("variable", variableMutator)
+ RegisterBottomUpMutator("variable", variableMutator).Parallel()
}
type variableProperties struct {