Skip to content

Commit f7e9aa3

Browse files
author
git apple-llvm automerger
committed
Merge commit 'a269d33329a4' from apple/stable/20200714 into swift/release/5.4
2 parents 4a0987a + a269d33 commit f7e9aa3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

llvm/lib/Support/Signposts.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "llvm/Config/config.h"
1414
#if LLVM_SUPPORT_XCODE_SIGNPOSTS
1515
#include "llvm/ADT/DenseMap.h"
16+
#include "llvm/Support/Mutex.h"
1617
#include <os/signpost.h>
1718
#endif // if LLVM_SUPPORT_XCODE_SIGNPOSTS
1819

@@ -38,9 +39,11 @@ class SignpostEmitterImpl {
3839

3940
LogPtrTy SignpostLog;
4041
DenseMap<const void *, os_signpost_id_t> Signposts;
42+
sys::SmartMutex<true> Mutex;
4143

4244
LogTy &getLogger() const { return *SignpostLog; }
4345
os_signpost_id_t getSignpostForObject(const void *O) {
46+
sys::SmartScopedLock<true> Lock(Mutex);
4447
const auto &I = Signposts.find(O);
4548
if (I != Signposts.end())
4649
return I->second;

0 commit comments

Comments
 (0)