forked from OSchip/llvm-project
[lldb/Platform] Synchronize access to SDK String Map.
The SwiftASTContext queries this function in parallel and requires synchronization.
This commit is contained in:
parent
b14c37a29a
commit
75c3d6f49c
|
@ -1762,6 +1762,7 @@ PlatformDarwin::FindXcodeContentsDirectoryInPath(llvm::StringRef path) {
|
|||
}
|
||||
|
||||
std::string PlatformDarwin::GetSDKPath(XcodeSDK sdk) {
|
||||
std::lock_guard<std::mutex> guard(m_sdk_path_mutex);
|
||||
std::string &path = m_sdk_path[sdk.GetString()];
|
||||
if (!path.empty())
|
||||
return path;
|
||||
|
|
|
@ -171,6 +171,7 @@ protected:
|
|||
|
||||
std::string m_developer_directory;
|
||||
llvm::StringMap<std::string> m_sdk_path;
|
||||
std::mutex m_sdk_path_mutex;
|
||||
|
||||
private:
|
||||
DISALLOW_COPY_AND_ASSIGN(PlatformDarwin);
|
||||
|
|
Loading…
Reference in New Issue