Skip to content

Commit 75c3d6f

Browse files
committed
[lldb/Platform] Synchronize access to SDK String Map.
The SwiftASTContext queries this function in parallel and requires synchronization.
1 parent b14c37a commit 75c3d6f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,7 @@ PlatformDarwin::FindXcodeContentsDirectoryInPath(llvm::StringRef path) {
17621762
}
17631763

17641764
std::string PlatformDarwin::GetSDKPath(XcodeSDK sdk) {
1765+
std::lock_guard<std::mutex> guard(m_sdk_path_mutex);
17651766
std::string &path = m_sdk_path[sdk.GetString()];
17661767
if (!path.empty())
17671768
return path;

lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ class PlatformDarwin : public PlatformPOSIX {
171171

172172
std::string m_developer_directory;
173173
llvm::StringMap<std::string> m_sdk_path;
174+
std::mutex m_sdk_path_mutex;
174175

175176
private:
176177
DISALLOW_COPY_AND_ASSIGN(PlatformDarwin);

0 commit comments

Comments
 (0)