diff options
author | Owen Anderson <resistor@mac.com> | 2010-07-28 22:49:43 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2010-07-28 22:49:43 +0000 |
commit | cfc2a57fcdac7ba32ebbd8f4c4b571427ceaabed (patch) | |
tree | fc77db6dac1b521097a437cd5ce284d1606eed21 /llvm/lib/System | |
parent | b22f1c8bf70eebec987461b6ea03e11b9b930c11 (diff) | |
download | bcm5719-llvm-cfc2a57fcdac7ba32ebbd8f4c4b571427ceaabed.tar.gz bcm5719-llvm-cfc2a57fcdac7ba32ebbd8f4c4b571427ceaabed.zip |
Add an erase() method to llvm::ThreadLocal.
llvm-svn: 109686
Diffstat (limited to 'llvm/lib/System')
-rw-r--r-- | llvm/lib/System/ThreadLocal.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/System/Unix/ThreadLocal.inc | 1 | ||||
-rw-r--r-- | llvm/lib/System/Win32/ThreadLocal.inc | 4 |
3 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/System/ThreadLocal.cpp b/llvm/lib/System/ThreadLocal.cpp index e7054b52814..b84a8e7fd6f 100644 --- a/llvm/lib/System/ThreadLocal.cpp +++ b/llvm/lib/System/ThreadLocal.cpp @@ -67,6 +67,10 @@ const void* ThreadLocalImpl::getInstance() { return pthread_getspecific(*key); } +void ThreadLocalImpl::removeInstance() { + setInstance(0); +} + } #elif defined(LLVM_ON_UNIX) diff --git a/llvm/lib/System/Unix/ThreadLocal.inc b/llvm/lib/System/Unix/ThreadLocal.inc index 83d554d3077..6769520a6fb 100644 --- a/llvm/lib/System/Unix/ThreadLocal.inc +++ b/llvm/lib/System/Unix/ThreadLocal.inc @@ -22,4 +22,5 @@ ThreadLocalImpl::ThreadLocalImpl() { } ThreadLocalImpl::~ThreadLocalImpl() { } void ThreadLocalImpl::setInstance(const void* d) { data = const_cast<void*>(d);} const void* ThreadLocalImpl::getInstance() { return data; } +void ThreadLocalImpl::removeInstance() { setInstance(0); } } diff --git a/llvm/lib/System/Win32/ThreadLocal.inc b/llvm/lib/System/Win32/ThreadLocal.inc index c8f7840b003..b8b933c4d29 100644 --- a/llvm/lib/System/Win32/ThreadLocal.inc +++ b/llvm/lib/System/Win32/ThreadLocal.inc @@ -46,4 +46,8 @@ void ThreadLocalImpl::setInstance(const void* d){ assert(errorcode != 0); } +void ThreadLocalImpl::removeInstance() { + setInstance(0); +} + } |