diff options
author | Howard Hinnant <hhinnant@apple.com> | 2010-10-14 19:18:04 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2010-10-14 19:18:04 +0000 |
commit | 10e4a48a2666d48f9acf8ed6494a863463c90183 (patch) | |
tree | 28887508fc3daa0a183afaf25d0d6a9b8ac94ea9 /libcxx/src/thread.cpp | |
parent | eafcb27ded221399df5e6eb1af4f498250b35eec (diff) | |
download | bcm5719-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.cpp | 7 |
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 |