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/include | |
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/include')
-rw-r--r-- | libcxx/include/future | 4 | ||||
-rw-r--r-- | libcxx/include/thread | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libcxx/include/future b/libcxx/include/future index d482577e525..5e53a96b51b 100644 --- a/libcxx/include/future +++ b/libcxx/include/future @@ -677,7 +677,7 @@ __assoc_state<_R>::set_value_at_thread_exit(_Arg& __arg) throw future_error(make_error_code(future_errc::promise_already_satisfied)); ::new(&__value_) _R(_STD::forward<_Arg>(__arg)); this->__state_ |= base::__constructed; - __thread_local_data->__make_ready_at_thread_exit(this); + __thread_local_data()->__make_ready_at_thread_exit(this); __lk.unlock(); } @@ -750,7 +750,7 @@ __assoc_state<_R&>::set_value_at_thread_exit(_R& __arg) throw future_error(make_error_code(future_errc::promise_already_satisfied)); __value_ = &__arg; this->__state_ |= base::__constructed; - __thread_local_data->__make_ready_at_thread_exit(this); + __thread_local_data()->__make_ready_at_thread_exit(this); __lk.unlock(); } diff --git a/libcxx/include/thread b/libcxx/include/thread index 25246fa08f0..7b6cf9323f1 100644 --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -318,13 +318,13 @@ public: 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; |