diff --git a/indra/llcommon/llqueuedthread.cpp b/indra/llcommon/llqueuedthread.cpp
index c418ba143bcb232271d5b605f17d73e64c11db59..60156d7eb70f53f744e0d7c43050fdf985e6cdc1 100644
--- a/indra/llcommon/llqueuedthread.cpp
+++ b/indra/llcommon/llqueuedthread.cpp
@@ -126,8 +126,6 @@ S32 LLQueuedThread::update(F32 max_time_ms)
 
 S32 LLQueuedThread::updateQueue(F32 max_time_ms)
 {
-	F64 max_time = (F64)max_time_ms * .001;
-	LLTimer timer;
 	S32 pending = 1;
 
 	// Frame Update
@@ -141,6 +139,8 @@ S32 LLQueuedThread::updateQueue(F32 max_time_ms)
 	}
 	else
 	{
+		F64 max_time = (F64)max_time_ms * .001;
+		LLTimer timer;
 		while (pending > 0)
 		{
 			pending = processNextRequest();
@@ -154,19 +154,16 @@ S32 LLQueuedThread::updateQueue(F32 max_time_ms)
 void LLQueuedThread::incQueue()
 {
 	// Something has been added to the queue
-	if (!isPaused())
+	if (mThreaded && !isPaused())
 	{
-		if (mThreaded)
-		{
-			wake(); // Wake the thread up if necessary.
-		}
+		wake(); // Wake the thread up if necessary.
 	}
 }
 
 // MAIN thread
 void LLQueuedThread::waitOnPending()
 {
-	while(1)
+	while (true)
 	{
 		update(0);
 
@@ -179,7 +176,6 @@ void LLQueuedThread::waitOnPending()
 			yield();
 		}
 	}
-	return;
 }
 
 // MAIN thread
@@ -204,7 +200,7 @@ LLQueuedThread::handle_t LLQueuedThread::generateHandle()
 	lockData();
 	while ((mNextHandle == nullHandle()) || (mRequestHash.find(mNextHandle)))
 	{
-		mNextHandle++;
+		++mNextHandle;
 	}
 	const LLQueuedThread::handle_t res = mNextHandle++;
 	unlockData();
@@ -396,7 +392,7 @@ S32 LLQueuedThread::processNextRequest()
 	// Get next request from pool
 	lockData();
 	
-	while(1)
+	while (true)
 	{
 		req = NULL;
 		if (mRequestQueue.empty())
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index 026487ce8cfa04237cfc99035609dc703c777cba..e6d32996ff180a548868f6a420c965acfb456ab2 100644
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -54,12 +54,12 @@ typedef struct tagTHREADNAME_INFO
 } THREADNAME_INFO;
 #pragma pack(pop)
 
-void set_thread_name( DWORD dwThreadID, const char* threadName)
+void set_thread_name(const char* threadName)
 {
     THREADNAME_INFO info;
     info.dwType = 0x1000;
     info.szName = threadName;
-    info.dwThreadID = dwThreadID;
+    info.dwThreadID = (DWORD)-1;
     info.dwFlags = 0;
 
     __try
@@ -132,7 +132,7 @@ void LLThread::registerThreadID() {}
 void LLThread::threadRun()
 {
 #ifdef LL_WINDOWS
-    set_thread_name(-1, mName.c_str());
+    set_thread_name(mName.c_str());
 #endif
 
     // this is the first point at which we're actually running in the new thread