File tree Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Expand file tree Collapse file tree 1 file changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -92,20 +92,18 @@ static bool getSymbolNameAddr(llvm::StringRef libraryName,
92
92
// providing failure status instead of just returning the original string like
93
93
// swift demangle.
94
94
#if defined(_WIN32)
95
- DWORD dwFlags = UNDNAME_COMPLETE;
96
- #if !defined(_WIN64)
97
- dwFlags |= UNDNAME_32_BIT_DECODE;
98
- #endif
99
- static std::mutex mutex;
95
+ static StaticMutex mutex;
100
96
101
97
char szUndName[1024 ];
102
- DWORD dwResult;
98
+ DWORD dwResult = mutex.withLock ([&syminfo, &szUndName]() {
99
+ DWORD dwFlags = UNDNAME_COMPLETE;
100
+ #if !defined(_WIN64)
101
+ dwFlags |= UNDNAME_32_BIT_DECODE;
102
+ #endif
103
103
104
- {
105
- std::lock_guard<std::mutex> lock (mutex);
106
- dwResult = UnDecorateSymbolName (syminfo.symbolName .get (), szUndName,
107
- sizeof (szUndName), dwFlags);
108
- }
104
+ return UnDecorateSymbolName (syminfo.symbolName .get (), szUndName,
105
+ sizeof (szUndName), dwFlags);
106
+ });
109
107
110
108
if (dwResult == TRUE ) {
111
109
symbolName += szUndName;
You can’t perform that action at this time.
0 commit comments