[PATCH] D143461: [ClangScanDeps] Fix data race in `clang-scan-deps` tool
Argyrios Kyrtzidis via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 6 22:03:21 PST 2023
akyrtzi created this revision.
Herald added a project: All.
akyrtzi requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Found using TSan.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D143461
Files:
clang/tools/clang-scan-deps/ClangScanDeps.cpp
Index: clang/tools/clang-scan-deps/ClangScanDeps.cpp
===================================================================
--- clang/tools/clang-scan-deps/ClangScanDeps.cpp
+++ clang/tools/clang-scan-deps/ClangScanDeps.cpp
@@ -260,6 +260,8 @@
mergeDeps(std::move(TUDeps.ModuleGraph), InputIndex);
ID.DriverCommandLine = std::move(TUDeps.DriverCommandLine);
ID.Commands = std::move(TUDeps.Commands);
+
+ std::unique_lock<std::mutex> ul(Lock);
Inputs.push_back(std::move(ID));
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D143461.495377.patch
Type: text/x-patch
Size: 503 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230207/a0454454/attachment.bin>
More information about the cfe-commits
mailing list