diff options
Diffstat (limited to 'lib/System/ThreadLocal.cpp')
-rw-r--r-- | lib/System/ThreadLocal.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/System/ThreadLocal.cpp b/lib/System/ThreadLocal.cpp index 74afa3e953..f8b00d152a 100644 --- a/lib/System/ThreadLocal.cpp +++ b/lib/System/ThreadLocal.cpp @@ -25,8 +25,8 @@ namespace llvm { using namespace sys; ThreadLocalImpl::ThreadLocalImpl() { } ThreadLocalImpl::~ThreadLocalImpl() { } -void ThreadLocalImpl::setInstance(void* d) { data = d; } -void* ThreadLocalImpl::getInstance() { return data; } +void ThreadLocalImpl::setInstance(const void* d) { data = const_cast<void*>(d);} +const void* ThreadLocalImpl::getInstance() { return data; } } #else @@ -53,13 +53,13 @@ ThreadLocalImpl::~ThreadLocalImpl() { delete key; } -void ThreadLocalImpl::setInstance(void* d) { +void ThreadLocalImpl::setInstance(const void* d) { pthread_key_t* key = static_cast<pthread_key_t*>(data); int errorcode = pthread_setspecific(*key, d); assert(errorcode == 0); } -void* ThreadLocalImpl::getInstance() { +const void* ThreadLocalImpl::getInstance() { pthread_key_t* key = static_cast<pthread_key_t*>(data); return pthread_getspecific(*key); } |