Skip to content
Snippets Groups Projects
Commit 2da54573 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Misc cleanup

parent 90880464
No related branches found
No related tags found
No related merge requests found
...@@ -126,8 +126,6 @@ S32 LLQueuedThread::update(F32 max_time_ms) ...@@ -126,8 +126,6 @@ S32 LLQueuedThread::update(F32 max_time_ms)
S32 LLQueuedThread::updateQueue(F32 max_time_ms) S32 LLQueuedThread::updateQueue(F32 max_time_ms)
{ {
F64 max_time = (F64)max_time_ms * .001;
LLTimer timer;
S32 pending = 1; S32 pending = 1;
// Frame Update // Frame Update
...@@ -141,6 +139,8 @@ S32 LLQueuedThread::updateQueue(F32 max_time_ms) ...@@ -141,6 +139,8 @@ S32 LLQueuedThread::updateQueue(F32 max_time_ms)
} }
else else
{ {
F64 max_time = (F64)max_time_ms * .001;
LLTimer timer;
while (pending > 0) while (pending > 0)
{ {
pending = processNextRequest(); pending = processNextRequest();
...@@ -154,19 +154,16 @@ S32 LLQueuedThread::updateQueue(F32 max_time_ms) ...@@ -154,19 +154,16 @@ S32 LLQueuedThread::updateQueue(F32 max_time_ms)
void LLQueuedThread::incQueue() void LLQueuedThread::incQueue()
{ {
// Something has been added to the queue // 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 // MAIN thread
void LLQueuedThread::waitOnPending() void LLQueuedThread::waitOnPending()
{ {
while(1) while (true)
{ {
update(0); update(0);
...@@ -179,7 +176,6 @@ void LLQueuedThread::waitOnPending() ...@@ -179,7 +176,6 @@ void LLQueuedThread::waitOnPending()
yield(); yield();
} }
} }
return;
} }
// MAIN thread // MAIN thread
...@@ -204,7 +200,7 @@ LLQueuedThread::handle_t LLQueuedThread::generateHandle() ...@@ -204,7 +200,7 @@ LLQueuedThread::handle_t LLQueuedThread::generateHandle()
lockData(); lockData();
while ((mNextHandle == nullHandle()) || (mRequestHash.find(mNextHandle))) while ((mNextHandle == nullHandle()) || (mRequestHash.find(mNextHandle)))
{ {
mNextHandle++; ++mNextHandle;
} }
const LLQueuedThread::handle_t res = mNextHandle++; const LLQueuedThread::handle_t res = mNextHandle++;
unlockData(); unlockData();
...@@ -396,7 +392,7 @@ S32 LLQueuedThread::processNextRequest() ...@@ -396,7 +392,7 @@ S32 LLQueuedThread::processNextRequest()
// Get next request from pool // Get next request from pool
lockData(); lockData();
while(1) while (true)
{ {
req = NULL; req = NULL;
if (mRequestQueue.empty()) if (mRequestQueue.empty())
......
...@@ -54,12 +54,12 @@ typedef struct tagTHREADNAME_INFO ...@@ -54,12 +54,12 @@ typedef struct tagTHREADNAME_INFO
} THREADNAME_INFO; } THREADNAME_INFO;
#pragma pack(pop) #pragma pack(pop)
void set_thread_name( DWORD dwThreadID, const char* threadName) void set_thread_name(const char* threadName)
{ {
THREADNAME_INFO info; THREADNAME_INFO info;
info.dwType = 0x1000; info.dwType = 0x1000;
info.szName = threadName; info.szName = threadName;
info.dwThreadID = dwThreadID; info.dwThreadID = (DWORD)-1;
info.dwFlags = 0; info.dwFlags = 0;
__try __try
...@@ -132,7 +132,7 @@ void LLThread::registerThreadID() {} ...@@ -132,7 +132,7 @@ void LLThread::registerThreadID() {}
void LLThread::threadRun() void LLThread::threadRun()
{ {
#ifdef LL_WINDOWS #ifdef LL_WINDOWS
set_thread_name(-1, mName.c_str()); set_thread_name(mName.c_str());
#endif #endif
// this is the first point at which we're actually running in the new thread // this is the first point at which we're actually running in the new thread
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment