diff options
author | Brad Linden <46733234+brad-linden@users.noreply.github.com> | 2024-07-09 17:41:15 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-09 17:41:15 -0500 |
commit | b6447dec4c3cb870b9ce3c1dda01d878d60b9f8b (patch) | |
tree | 7289668c6e990c926e2974057c8d6024372dc5a1 /indra | |
parent | 08f2236736f00a1f1d8b2d042b7423fb306dc94f (diff) | |
parent | d9782cf9660bd08b2577d79b29e93129c838de3b (diff) |
Merge pull request #1967 from secondlife/1826-llerror-hangs-viewer
#1826 Fix for LL_ERRS crashing in mutex lock
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llcommon/llerror.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index a45bc32028..fa24987d1c 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -55,6 +55,7 @@ #include "llsingleton.h" #include "llstl.h" #include "lltimer.h" +#include <boost/fiber/recursive_mutex.hpp> // On Mac, got: // #error "Boost.Stacktrace requires `_Unwind_Backtrace` function. Define @@ -506,7 +507,7 @@ namespace LLError::TimeFunction mTimeFunction; Recorders mRecorders; - LLCoros::Mutex mRecorderMutex; + boost::fibers::recursive_mutex mRecorderMutex; int mShouldLogCallCounter; @@ -1044,7 +1045,7 @@ namespace LLError return; } SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig(); - LLCoros::LockType lock(s->mRecorderMutex); + std::unique_lock lock(s->mRecorderMutex); s->mRecorders.push_back(recorder); } @@ -1055,7 +1056,7 @@ namespace LLError return; } SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig(); - LLCoros::LockType lock(s->mRecorderMutex); + std::unique_lock lock(s->mRecorderMutex); s->mRecorders.erase(std::remove(s->mRecorders.begin(), s->mRecorders.end(), recorder), s->mRecorders.end()); } @@ -1104,7 +1105,7 @@ namespace LLError std::shared_ptr<RECORDER> findRecorder() { SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig(); - LLCoros::LockType lock(s->mRecorderMutex); + std::unique_lock lock(s->mRecorderMutex); return findRecorderPos<RECORDER>(s).first; } @@ -1115,7 +1116,7 @@ namespace LLError bool removeRecorder() { SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig(); - LLCoros::LockType lock(s->mRecorderMutex); + std::unique_lock lock(s->mRecorderMutex); auto found = findRecorderPos<RECORDER>(s); if (found.first) { @@ -1221,7 +1222,7 @@ namespace std::string escaped_message; - LLCoros::LockType lock(s->mRecorderMutex); + std::unique_lock lock(s->mRecorderMutex); for (LLError::RecorderPtr& r : s->mRecorders) { if (!r->enabled()) |