From 8786ec74ca426983338c874436ea17e6b4e11029 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 10 Aug 2013 20:54:55 -0700 Subject: [PATCH] Fix some potential threading probs with SymbolMap. Got some strange crashes. --- Core/Debugger/SymbolMap.cpp | 18 +++++++++++++++--- Core/Debugger/SymbolMap.h | 4 +++- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Core/Debugger/SymbolMap.cpp b/Core/Debugger/SymbolMap.cpp index c9a277e98b..ea23ca0fe2 100644 --- a/Core/Debugger/SymbolMap.cpp +++ b/Core/Debugger/SymbolMap.cpp @@ -52,7 +52,8 @@ static u32 ComputeHash(u32 start, u32 size) void SymbolMap::SortSymbols() { - std::sort(entries.begin(), entries.end()); + lock_guard guard(lock_); + std::sort(entries.begin(), entries.end()); } void SymbolMap::AnalyzeBackwards() @@ -104,6 +105,7 @@ void SymbolMap::AnalyzeBackwards() void SymbolMap::ResetSymbolMap() { + lock_guard guard(lock_); #ifdef BWLINKS for (int i=0; i #include #include @@ -106,6 +107,7 @@ private: std::set uniqueEntries; std::vector entries; std::map entryRanges; + mutable recursive_mutex lock_; }; extern SymbolMap symbolMap;