fix for SH-2434: Mac viewer sometimes freezes at start up and must be force quit.

meow-7.2.2
Xiaohong Bao 2011-10-05 15:21:10 -06:00
parent 77eb3aae04
commit 5ef05e151d
5 changed files with 11 additions and 6 deletions

View File

@ -32,7 +32,7 @@
//============================================================================
// MAIN THREAD
LLQueuedThread::LLQueuedThread(const std::string& name, bool threaded) :
LLQueuedThread::LLQueuedThread(const std::string& name, bool threaded, bool should_pause) :
LLThread(name),
mThreaded(threaded),
mIdleThread(TRUE),
@ -41,6 +41,11 @@ LLQueuedThread::LLQueuedThread(const std::string& name, bool threaded) :
{
if (mThreaded)
{
if(should_pause)
{
pause() ; //call this before start the thread.
}
start();
}
}

View File

@ -149,7 +149,7 @@ public:
static handle_t nullHandle() { return handle_t(0); }
public:
LLQueuedThread(const std::string& name, bool threaded = true);
LLQueuedThread(const std::string& name, bool threaded = true, bool should_pause = false);
virtual ~LLQueuedThread();
virtual void shutdown();

View File

@ -34,8 +34,8 @@
//============================================================================
// Run on MAIN thread
LLWorkerThread::LLWorkerThread(const std::string& name, bool threaded) :
LLQueuedThread(name, threaded)
LLWorkerThread::LLWorkerThread(const std::string& name, bool threaded, bool should_pause) :
LLQueuedThread(name, threaded, should_pause)
{
mDeleteMutex = new LLMutex;
}

View File

@ -83,7 +83,7 @@ private:
LLMutex* mDeleteMutex;
public:
LLWorkerThread(const std::string& name, bool threaded = true);
LLWorkerThread(const std::string& name, bool threaded = true, bool should_pause = false);
~LLWorkerThread();
/*virtual*/ S32 update(U32 max_time_ms);

View File

@ -1810,7 +1810,7 @@ bool LLTextureFetchWorker::writeToCacheComplete()
// public
LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* imagedecodethread, bool threaded, bool qa_mode)
: LLWorkerThread("TextureFetch", threaded),
: LLWorkerThread("TextureFetch", threaded, true),
mDebugCount(0),
mDebugPause(FALSE),
mPacketCount(0),