File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -590,6 +590,7 @@ SwiftDependencyScanningService::getDependenciesMap(
590590}
591591
592592void SwiftDependencyScanningService::configureForContextHash (StringRef scanningContextHash) {
593+ llvm::sys::SmartScopedLock<true > Lock (ScanningServiceGlobalLock);
593594 auto knownContext = ContextSpecificCacheMap.find (scanningContextHash);
594595 if (knownContext == ContextSpecificCacheMap.end ()) {
595596 // First time scanning with this context, initialize context-specific state.
@@ -599,7 +600,6 @@ void SwiftDependencyScanningService::configureForContextHash(StringRef scanningC
599600 kind != ModuleDependencyKind::LastKind; ++kind) {
600601 contextSpecificCache->ModuleDependenciesMap .insert ({kind, ModuleNameToDependencyMap ()});
601602 }
602- llvm::sys::SmartScopedLock<true > Lock (ScanningServiceGlobalLock);
603603 ContextSpecificCacheMap.insert ({scanningContextHash.str (), std::move (contextSpecificCache)});
604604 AllContextHashes.push_back (scanningContextHash.str ());
605605 }
Original file line number Diff line number Diff line change @@ -215,10 +215,12 @@ bool DependencyScanningTool::loadCache(llvm::StringRef path) {
215215}
216216
217217void DependencyScanningTool::resetCache () {
218+ llvm::sys::SmartScopedLock<true > Lock (DependencyScanningToolStateLock);
218219 ScanningService.reset (new SwiftDependencyScanningService ());
219220}
220221
221222void DependencyScanningTool::resetDiagnostics () {
223+ llvm::sys::SmartScopedLock<true > Lock (DependencyScanningToolStateLock);
222224 CDC.reset ();
223225}
224226
You can’t perform that action at this time.
0 commit comments