summaryrefslogtreecommitdiff
path: root/indra/llcommon/llthread.cpp
diff options
context:
space:
mode:
authorCinder <cinder@sdf.org>2014-11-19 08:01:28 -0700
committerCinder <cinder@sdf.org>2014-11-19 08:01:28 -0700
commit5f608c0a23487ae78cdc134b1e685a6c3cd4ec19 (patch)
tree92c7f33bf9009533c96da91680b0b0583d822e48 /indra/llcommon/llthread.cpp
parenta74d0d44d15d5cdc8f86b1b80153721415afa82e (diff)
OPEN-282 Use pthreads for TLS on mac
Diffstat (limited to 'indra/llcommon/llthread.cpp')
-rwxr-xr-xindra/llcommon/llthread.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp
index 51c89e1eaf..22e8179b6c 100755
--- a/indra/llcommon/llthread.cpp
+++ b/indra/llcommon/llthread.cpp
@@ -92,11 +92,9 @@ void set_thread_name( DWORD dwThreadID, const char* threadName)
//
//----------------------------------------------------------------------------
-#if LL_DARWIN
-// statically allocated thread local storage not supported in Darwin executable formats
-#elif LL_WINDOWS
+#if LL_WINDOWS
U32 __declspec(thread) sThreadID = 0;
-#elif LL_LINUX
+#else
U32 __thread sThreadID = 0;
#endif
@@ -115,9 +113,7 @@ LL_COMMON_API void assert_main_thread()
void LLThread::registerThreadID()
{
-#if !LL_DARWIN
sThreadID = ++sIDIter;
-#endif
}
//
@@ -134,9 +130,7 @@ void *APR_THREAD_FUNC LLThread::staticRun(apr_thread_t *apr_threadp, void *datap
// for now, hard code all LLThreads to report to single master thread recorder, which is known to be running on main thread
threadp->mRecorder = new LLTrace::ThreadRecorder(*LLTrace::get_master_thread_recorder());
-#if !LL_DARWIN
sThreadID = threadp->mID;
-#endif
// Run the user supplied function
threadp->run();
@@ -347,13 +341,7 @@ 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