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,
9292 // providing failure status instead of just returning the original string like
9393 // swift demangle.
9494#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;
10096
10197 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
103103
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+ });
109107
110108 if (dwResult == TRUE ) {
111109 symbolName += szUndName;
You can’t perform that action at this time.
0 commit comments