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(
590
590
}
591
591
592
592
void SwiftDependencyScanningService::configureForContextHash (StringRef scanningContextHash) {
593
+ llvm::sys::SmartScopedLock<true > Lock (ScanningServiceGlobalLock);
593
594
auto knownContext = ContextSpecificCacheMap.find (scanningContextHash);
594
595
if (knownContext == ContextSpecificCacheMap.end ()) {
595
596
// First time scanning with this context, initialize context-specific state.
@@ -599,7 +600,6 @@ void SwiftDependencyScanningService::configureForContextHash(StringRef scanningC
599
600
kind != ModuleDependencyKind::LastKind; ++kind) {
600
601
contextSpecificCache->ModuleDependenciesMap .insert ({kind, ModuleNameToDependencyMap ()});
601
602
}
602
- llvm::sys::SmartScopedLock<true > Lock (ScanningServiceGlobalLock);
603
603
ContextSpecificCacheMap.insert ({scanningContextHash.str (), std::move (contextSpecificCache)});
604
604
AllContextHashes.push_back (scanningContextHash.str ());
605
605
}
Original file line number Diff line number Diff line change @@ -215,10 +215,12 @@ bool DependencyScanningTool::loadCache(llvm::StringRef path) {
215
215
}
216
216
217
217
void DependencyScanningTool::resetCache () {
218
+ llvm::sys::SmartScopedLock<true > Lock (DependencyScanningToolStateLock);
218
219
ScanningService.reset (new SwiftDependencyScanningService ());
219
220
}
220
221
221
222
void DependencyScanningTool::resetDiagnostics () {
223
+ llvm::sys::SmartScopedLock<true > Lock (DependencyScanningToolStateLock);
222
224
CDC.reset ();
223
225
}
224
226
You can’t perform that action at this time.
0 commit comments