From 68967e7b2b9416ff66cb49ae755fb33d7b81d129 Mon Sep 17 00:00:00 2001
From: Richard Linden <none@none>
Date: Wed, 5 Dec 2012 14:22:18 -0800
Subject: SH-3406 WIP convert fast timers to lltrace system changed thread id
 declaration to be local to llthread.cpp and use currentID() uniformly across
 platforms

---
 indra/llcommon/llmutex.cpp  |  8 --------
 indra/llcommon/llthread.cpp | 10 ++++++++--
 indra/llcommon/llthread.h   |  7 -------
 3 files changed, 8 insertions(+), 17 deletions(-)

(limited to 'indra')

diff --git a/indra/llcommon/llmutex.cpp b/indra/llcommon/llmutex.cpp
index e6beb9e680..b685bb4d60 100644
--- a/indra/llcommon/llmutex.cpp
+++ b/indra/llcommon/llmutex.cpp
@@ -83,11 +83,7 @@ void LLMutex::lock()
 	mIsLocked[id] = TRUE;
 #endif
 
-#if LL_DARWIN
 	mLockingThread = LLThread::currentID();
-#else
-	mLockingThread = LLThread::sThreadID;
-#endif
 }
 
 void LLMutex::unlock()
@@ -126,11 +122,7 @@ bool LLMutex::isLocked()
 
 bool LLMutex::isSelfLocked()
 {
-#if LL_DARWIN
 	return mLockingThread == LLThread::currentID();
-#else
-	return mLockingThread == LLThread::sThreadID;
-#endif
 }
 
 U32 LLMutex::lockingThread() const
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index 8ce739bf23..6374b5398b 100644
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -62,9 +62,9 @@
 #if LL_DARWIN
 // statically allocated thread local storage not supported in Darwin executable formats
 #elif LL_WINDOWS
-U32 __declspec(thread) LLThread::sThreadID = 0;
+U32 __declspec(thread) sThreadID = 0;
 #elif LL_LINUX
-U32 __thread LLThread::sThreadID = 0;
+U32 __thread sThreadID = 0;
 #endif 
 
 U32 LLThread::sIDIter = 0;
@@ -294,7 +294,13 @@ void LLThread::setQuitting()
 // static
 U32 LLThread::currentID()
 {
+#if LL_DARWIN
+	// statically allocated thread local storage not supported in Darwin executable formats
 	return (U32)apr_os_thread_current();
+#else
+	return sThreadID;
+#endif
+
 }
 
 // static
diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h
index 75222c83f9..92323f5fda 100644
--- a/indra/llcommon/llthread.h
+++ b/indra/llcommon/llthread.h
@@ -39,13 +39,6 @@ class LL_COMMON_API LLThread
 private:
 	friend class LLMutex;
 	static U32 sIDIter;
-#if LL_DARWIN
-	// statically allocated thread local storage not supported in Darwin executable formats
-#elif LL_WINDOWS
-	static U32 __declspec(thread) LLThread::sThreadID;
-#elif LL_LINUX
-	static U32 __thread LLThread::sThreadID ;
-#endif
 
 public:
 	typedef enum e_thread_status
-- 
cgit v1.2.3