Convert __thread_local_data to the singleton pattern

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@116500 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/thread b/include/thread
index 25246fa..7b6cf93 100644
--- a/include/thread
+++ b/include/thread
@@ -318,13 +318,13 @@
     void __make_ready_at_thread_exit(__assoc_sub_state*);
 };
 
-extern __thread_specific_ptr<__thread_struct> __thread_local_data;
+__thread_specific_ptr<__thread_struct>& __thread_local_data();
 
 template <class _F>
 void*
 __thread_proxy(void* __vp)
 {
-    __thread_local_data.reset(new __thread_struct);
+    __thread_local_data().reset(new __thread_struct);
     std::unique_ptr<_F> __p(static_cast<_F*>(__vp));
     (*__p)();
     return nullptr;