BaoLinden avatar BaoLinden committed b35c23c

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

Comments (0)

Files changed (5)

indra/llcommon/llqueuedthread.cpp

 //============================================================================
 
 // 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),
 {
 	if (mThreaded)
 	{
+		if(should_pause)
+		{
+			pause() ; //call this before start the thread.
+		}
+
 		start();
 	}
 }

indra/llcommon/llqueuedthread.h

 	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();
 	

indra/llcommon/llworkerthread.cpp

 //============================================================================
 // 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;
 }

indra/llcommon/llworkerthread.h

 	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);

indra/newview/lltexturefetch.cpp

 // 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),
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.