diff options
author | 2024-10-11 18:50:35 +0000 | |
---|---|---|
committer | 2024-10-11 18:50:35 +0000 | |
commit | 28673b0f3e601c02ad44407db7153a99b038a3f5 (patch) | |
tree | 06f6bf69aa1eb3998fd3c46e48749ca62e1f36cf /fsgen/filesystem_creator.go | |
parent | 7bda7166dd3d771b714bb553f7745c9fcc2240c2 (diff) | |
parent | c7e58c90be57a9b48a4ecd1eff1fde66df4c72b0 (diff) |
Merge "Use global mutex for fsDeps update" into main
Diffstat (limited to 'fsgen/filesystem_creator.go')
-rw-r--r-- | fsgen/filesystem_creator.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go index cd63dc2da..ed0c390ba 100644 --- a/fsgen/filesystem_creator.go +++ b/fsgen/filesystem_creator.go @@ -45,6 +45,7 @@ func RegisterCollectFileSystemDepsMutators(ctx android.RegisterMutatorsContext) ctx.BottomUp("fs_collect_deps", collectDepsMutator).MutatesGlobalState() } +var fsDepsMutex = sync.Mutex{} var collectFsDepsOnceKey = android.NewOnceKey("CollectFsDeps") var depCandidatesOnceKey = android.NewOnceKey("DepCandidates") @@ -80,12 +81,11 @@ func collectDepsMutator(mctx android.BottomUpMutatorContext) { }).(*[]string) m := mctx.Module() - mutex := &sync.Mutex{} if slices.Contains(*depCandidates, m.Name()) { if installInSystem(mctx, m) { - mutex.Lock() + fsDepsMutex.Lock() *fsDeps = append(*fsDeps, m.Name()) - mutex.Unlock() + fsDepsMutex.Unlock() } } } |