android: Allow running some singletons in parallel.

Many of the singletons are trivial and can be run in parallel, improving
the performance during analysis.

Bug: 281536768
Test: manual, presubmit
Change-Id: I989333e2ff3fe71783601f27bf5e0732a1b4ea61
This commit is contained in:
LaMont Jones
2023-05-15 21:50:29 +00:00
parent fcb86824be
commit e59c0db536
2 changed files with 51 additions and 13 deletions

View File

@@ -495,8 +495,18 @@ func (ctx *TestContext) RegisterSingletonModuleType(name string, factory Singlet
ctx.RegisterModuleType(name, m)
}
func (ctx *TestContext) RegisterParallelSingletonModuleType(name string, factory SingletonModuleFactory) {
s, m := SingletonModuleFactoryAdaptor(name, factory)
ctx.RegisterParallelSingletonType(name, s)
ctx.RegisterModuleType(name, m)
}
func (ctx *TestContext) RegisterSingletonType(name string, factory SingletonFactory) {
ctx.singletons = append(ctx.singletons, newSingleton(name, factory))
ctx.singletons = append(ctx.singletons, newSingleton(name, factory, false))
}
func (ctx *TestContext) RegisterParallelSingletonType(name string, factory SingletonFactory) {
ctx.singletons = append(ctx.singletons, newSingleton(name, factory, true))
}
func (ctx *TestContext) RegisterPreSingletonType(name string, factory SingletonFactory) {