summaryrefslogtreecommitdiffstats
path: root/libcxx/src/thread.cpp
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2010-10-14 19:18:04 +0000
committerHoward Hinnant <hhinnant@apple.com>2010-10-14 19:18:04 +0000
commit10e4a48a2666d48f9acf8ed6494a863463c90183 (patch)
tree28887508fc3daa0a183afaf25d0d6a9b8ac94ea9 /libcxx/src/thread.cpp
parenteafcb27ded221399df5e6eb1af4f498250b35eec (diff)
downloadbcm5719-llvm-10e4a48a2666d48f9acf8ed6494a863463c90183.tar.gz
bcm5719-llvm-10e4a48a2666d48f9acf8ed6494a863463c90183.zip
Convert __thread_local_data to the singleton pattern
llvm-svn: 116500
Diffstat (limited to 'libcxx/src/thread.cpp')
-rw-r--r--libcxx/src/thread.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp
index 3d388e9f030..aa075133a31 100644
--- a/libcxx/src/thread.cpp
+++ b/libcxx/src/thread.cpp
@@ -83,7 +83,12 @@ sleep_for(const chrono::nanoseconds& ns)
} // this_thread
-__thread_specific_ptr<__thread_struct> __thread_local_data;
+__thread_specific_ptr<__thread_struct>&
+__thread_local_data()
+{
+ static __thread_specific_ptr<__thread_struct> __p;
+ return __p;
+}
// __thread_struct_imp
OpenPOWER on IntegriCloud