Set REQUIRES shell on the test cases for r186044
[oota-llvm.git] / lib / Support / ThreadLocal.cpp
index 109580478deeb6003cc615cb246503813a428ed2..0587aaec7e68fc2c9ca6dacef2095610dac2c2c1 100644 (file)
@@ -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