[PATCH] D94285: [llvm] Protect signpost map with a mutex
Jonas Devlieghere via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 19 11:42:15 PST 2021
This revision was automatically updated to reflect the committed changes.
JDevlieghere marked an inline comment as done.
Closed by commit rGa4b42c621b9e: [llvm] Protect signpost map with a mutex (authored by JDevlieghere).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94285/new/
https://reviews.llvm.org/D94285
Files:
llvm/lib/Support/Signposts.cpp
Index: llvm/lib/Support/Signposts.cpp
===================================================================
--- llvm/lib/Support/Signposts.cpp
+++ llvm/lib/Support/Signposts.cpp
@@ -13,6 +13,7 @@
#include "llvm/Config/config.h"
#if LLVM_SUPPORT_XCODE_SIGNPOSTS
#include "llvm/ADT/DenseMap.h"
+#include "llvm/Support/Mutex.h"
#include <os/signpost.h>
#endif // if LLVM_SUPPORT_XCODE_SIGNPOSTS
@@ -38,9 +39,11 @@
LogPtrTy SignpostLog;
DenseMap<const void *, os_signpost_id_t> Signposts;
+ sys::SmartMutex<true> Mutex;
LogTy &getLogger() const { return *SignpostLog; }
os_signpost_id_t getSignpostForObject(const void *O) {
+ sys::SmartScopedLock<true> Lock(Mutex);
const auto &I = Signposts.find(O);
if (I != Signposts.end())
return I->second;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94285.317642.patch
Type: text/x-patch
Size: 784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210119/72d24fa1/attachment.bin>
More information about the llvm-commits
mailing list