Workaround for mac startup hardlock. (STORM-1641)

This commit is contained in:
Shyotl
2011-10-18 09:33:20 -05:00
parent 4446b0fbad
commit 82b0171a86
5 changed files with 11 additions and 6 deletions

View File

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

View File

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

View File

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

View File

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

View File

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