summaryrefslogtreecommitdiff
path: root/indra/llcommon/llthreadlocalstorage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llcommon/llthreadlocalstorage.cpp')
-rw-r--r--indra/llcommon/llthreadlocalstorage.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/indra/llcommon/llthreadlocalstorage.cpp b/indra/llcommon/llthreadlocalstorage.cpp
index 7858ee5429..32d94331a6 100644
--- a/indra/llcommon/llthreadlocalstorage.cpp
+++ b/indra/llcommon/llthreadlocalstorage.cpp
@@ -28,6 +28,7 @@
#include "linden_common.h"
#include "llthreadlocalstorage.h"
+#include "llapr.h"
//
//LLThreadLocalPointerBase
@@ -46,6 +47,21 @@ void LLThreadLocalPointerBase::set( void* value )
}
}
+void* LLThreadLocalPointerBase::get() const
+{
+ // llassert(sInitialized);
+ void* ptr;
+ apr_status_t result =
+ apr_threadkey_private_get(&ptr, mThreadKey);
+ if (result != APR_SUCCESS)
+ {
+ ll_apr_warn_status(result);
+ llerrs << "Failed to get thread local data" << llendl;
+ }
+ return ptr;
+}
+
+
void LLThreadLocalPointerBase::initStorage( )
{
apr_status_t result = apr_threadkey_private_create(&mThreadKey, NULL, gAPRPoolp);