diff options
Diffstat (limited to 'lib/Support/ThreadLocal.cpp')
-rw-r--r-- | lib/Support/ThreadLocal.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Support/ThreadLocal.cpp b/lib/Support/ThreadLocal.cpp index 109580478d..0587aaec7e 100644 --- a/lib/Support/ThreadLocal.cpp +++ b/lib/Support/ThreadLocal.cpp @@ -30,10 +30,12 @@ void ThreadLocalImpl::setInstance(const void* d) { void **pd = reinterpret_cast<void**>(&data); *pd = const_cast<void*>(d); } -const void* ThreadLocalImpl::getInstance() { return data; } -void ThreadLocalImpl::removeInstance() { +const void* ThreadLocalImpl::getInstance() { void **pd = reinterpret_cast<void**>(&data); - *pd = 0; + return *pd; +} +void ThreadLocalImpl::removeInstance() { + setInstance(0); } } #else |