We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4a0987a + a269d33 commit f7e9aa3Copy full SHA for f7e9aa3
llvm/lib/Support/Signposts.cpp
@@ -13,6 +13,7 @@
13
#include "llvm/Config/config.h"
14
#if LLVM_SUPPORT_XCODE_SIGNPOSTS
15
#include "llvm/ADT/DenseMap.h"
16
+#include "llvm/Support/Mutex.h"
17
#include <os/signpost.h>
18
#endif // if LLVM_SUPPORT_XCODE_SIGNPOSTS
19
@@ -38,9 +39,11 @@ class SignpostEmitterImpl {
38
39
40
LogPtrTy SignpostLog;
41
DenseMap<const void *, os_signpost_id_t> Signposts;
42
+ sys::SmartMutex<true> Mutex;
43
44
LogTy &getLogger() const { return *SignpostLog; }
45
os_signpost_id_t getSignpostForObject(const void *O) {
46
+ sys::SmartScopedLock<true> Lock(Mutex);
47
const auto &I = Signposts.find(O);
48
if (I != Signposts.end())
49
return I->second;
0 commit comments