diff options
author | 2019-02-04 11:22:08 -0800 | |
---|---|---|
committer | 2019-02-06 01:52:41 +0000 | |
commit | 571cccfcbc795f2bc955ca7fb3ac09085b360e09 (patch) | |
tree | 16da47a7ce728a0dfec6d48b1ef89c2cf72341f3 /android/apex.go | |
parent | 5cb5b093d1f49a160b6ef2994c6bce07793a7d2d (diff) |
Prepare for a type-safe OnceKey
Add an opaque OnceKey type and use it for all calls to Once in
build/soong. A future patch will convert the arguments to
Once* to OnceKey once users outside build/soong have been updated.
Test: onceper_test.go
Change-Id: Ifcb338e6e603e804e507203c9508d30ffb2df966
Diffstat (limited to 'android/apex.go')
-rw-r--r-- | android/apex.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/android/apex.go b/android/apex.go index a93baf6d4..bf11ba25f 100644 --- a/android/apex.go +++ b/android/apex.go @@ -139,6 +139,7 @@ func (m *ApexModuleBase) CreateApexVariations(mctx BottomUpMutatorContext) []blu var apexData OncePer var apexNamesMapMutex sync.Mutex +var apexNamesKey = NewOnceKey("apexNames") // This structure maintains the global mapping in between modules and APEXes. // Examples: @@ -147,7 +148,7 @@ var apexNamesMapMutex sync.Mutex // apexNamesMap()["foo"]["bar"] == false: module foo is indirectly depended on by APEX bar // apexNamesMap()["foo"]["bar"] doesn't exist: foo is not built for APEX bar func apexNamesMap() map[string]map[string]bool { - return apexData.Once("apexNames", func() interface{} { + return apexData.Once(apexNamesKey, func() interface{} { return make(map[string]map[string]bool) }).(map[string]map[string]bool) } |