diff options
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/llcharacter/llcharacter.h | 2 | ||||
-rwxr-xr-x | indra/llcommon/llthread.cpp | 6 | ||||
-rwxr-xr-x | indra/llcommon/llthread.h | 6 | ||||
-rw-r--r-- | indra/llcommon/lltrace.cpp | 2 |
4 files changed, 13 insertions, 3 deletions
diff --git a/indra/llcharacter/llcharacter.h b/indra/llcharacter/llcharacter.h index 43fb68bb5c..b10a8a5f34 100755 --- a/indra/llcharacter/llcharacter.h +++ b/indra/llcharacter/llcharacter.h @@ -37,7 +37,7 @@ #include "llvisualparam.h" #include "llstringtable.h" #include "llpointer.h" -#include "llthread.h" +#include "llrefcount.h" class LLPolyMesh; diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index cf105098ef..368a059182 100755 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -132,7 +132,7 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap #endif // for now, hard code all LLThreads to report to single master thread recorder, which is known to be running on main thread - LLTrace::ThreadRecorder thread_recorder(*LLTrace::get_master_thread_recorder()); + mRecorder = new LLTrace::ThreadRecorder(*LLTrace::get_master_thread_recorder()); #if !LL_DARWIN sThreadID = threadp->mID; @@ -222,6 +222,8 @@ void LLThread::shutdown() // This thread just wouldn't stop, even though we gave it time //LL_WARNS() << "LLThread::~LLThread() exiting thread before clean exit!" << LL_ENDL; // Put a stake in its heart. + delete mRecorder; + apr_thread_exit(mAPRThreadp, -1); return; } @@ -239,6 +241,8 @@ void LLThread::shutdown() apr_pool_destroy(mAPRPoolp); mAPRPoolp = 0; } + + delete mRecorder; } diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index ba64d20936..2f9c779e00 100755 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -36,6 +36,11 @@ LL_COMMON_API void assert_main_thread(); +namespace LLTrace +{ + class ThreadRecorder; +} + class LL_COMMON_API LLThread { private: @@ -105,6 +110,7 @@ protected: BOOL mIsLocalPool; EThreadStatus mStatus; U32 mID; + LLTrace::ThreadRecorder* mRecorder; //a local apr_pool for APRFile operations in this thread. If it exists, LLAPRFile::sAPRFilePoolp should not be used. //Note: this pool is used by APRFile ONLY, do NOT use it for any other purposes. diff --git a/indra/llcommon/lltrace.cpp b/indra/llcommon/lltrace.cpp index 14e830af7d..54079a4689 100644 --- a/indra/llcommon/lltrace.cpp +++ b/indra/llcommon/lltrace.cpp @@ -40,7 +40,7 @@ StatBase::StatBase( const char* name, const char* description ) mDescription(description ? description : "") { #ifndef LL_RELEASE_FOR_DOWNLOAD - if (LLTrace::get_thread_recorder() != NULL) + if (LLTrace::get_thread_recorder().notNull()) { LL_ERRS() << "Attempting to declare trace object after program initialization. Trace objects should be statically initialized." << LL_ENDL; } |