diff options
author | Richard Linden <none@none> | 2013-07-15 11:05:57 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-07-15 11:05:57 -0700 |
commit | 11e14cd3b0f58225a96b9b7a9839a7f030fe4045 (patch) | |
tree | 926f515254483ac2e90a0f38bf24629767578318 /indra/llcommon/llthread.cpp | |
parent | c95042db3e8d2f1a938e7d6e9ca625700d634639 (diff) |
SH-4299Interesting: High fps shown temporarily off scale in statistics console
various fixes to lltrace
start() on started recording no longer resets
fixed various instances of unit forgetfullness in lltrace
recording split now has gapless timing
scene monitor now guarantees min sample time
renamed a bunch of stats
added names to debug thread view on windows
Diffstat (limited to 'indra/llcommon/llthread.cpp')
-rwxr-xr-x | indra/llcommon/llthread.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index 166a4eb26d..e0f53fb9c4 100755 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -39,6 +39,39 @@ #include <sched.h> #endif + +#ifdef LL_WINDOWS +const DWORD MS_VC_EXCEPTION=0x406D1388; + +#pragma pack(push,8) +typedef struct tagTHREADNAME_INFO +{ + DWORD dwType; // Must be 0x1000. + const char* szName; // Pointer to name (in user addr space). + DWORD dwThreadID; // Thread ID (-1=caller thread). + DWORD dwFlags; // Reserved for future use, must be zero. +} THREADNAME_INFO; +#pragma pack(pop) + +void SetThreadName( DWORD dwThreadID, const char* threadName) +{ + THREADNAME_INFO info; + info.dwType = 0x1000; + info.szName = threadName; + info.dwThreadID = dwThreadID; + info.dwFlags = 0; + + __try + { + RaiseException( MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (DWORD*)&info ); + } + __except(EXCEPTION_CONTINUE_EXECUTION) + { + } +} +#endif + + //---------------------------------------------------------------------------- // Usage: // void run_func(LLThread* thread) @@ -93,6 +126,11 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap { LLThread *threadp = (LLThread *)datap; +#ifdef LL_WINDOWS + SetThreadName(-1, threadp->mName.c_str()); +#endif + + LLTrace::ThreadRecorder thread_recorder(*LLTrace::get_master_thread_recorder()); #if !LL_DARWIN @@ -224,6 +262,7 @@ void LLThread::start() llwarns << "failed to start thread " << mName << llendl; ll_apr_warn_status(status); } + } //============================================================================ |