diff options
author | 2023-05-15 21:50:29 +0000 | |
---|---|---|
committer | 2023-05-19 18:01:35 +0000 | |
commit | e59c0db5360b850b444c3bed9b92b0fd30b15e1e (patch) | |
tree | 0dba113aa64c5402cc630a1ab2e1aadd2a1e1676 /android/testing.go | |
parent | fcb86824be33eea38a2a4e766c37929cf043b9f8 (diff) |
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
Diffstat (limited to 'android/testing.go')
-rw-r--r-- | android/testing.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/android/testing.go b/android/testing.go index 2a9c6584e..5ad7ad07f 100644 --- a/android/testing.go +++ b/android/testing.go @@ -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) { |