summaryrefslogtreecommitdiff
path: root/include/thread
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2013-04-27 17:27:12 +0000
committerDimitry Andric <dim@FreeBSD.org>2013-04-27 17:27:12 +0000
commit527d9fcb66574fdd657c3235c0d7cba7c5439d5c (patch)
treef4dbdda47a8f2e8eb8196e6a33ed834e8400837e /include/thread
parentc7f918d0681828afdbddfdcc354b6f3dfc2a7b68 (diff)
Notes
Diffstat (limited to 'include/thread')
-rw-r--r--include/thread24
1 files changed, 13 insertions, 11 deletions
diff --git a/include/thread b/include/thread
index 60d8885951d3..f41ea2902055 100644
--- a/include/thread
+++ b/include/thread
@@ -144,9 +144,11 @@ template <class _Tp>
__thread_specific_ptr<_Tp>::__thread_specific_ptr()
{
int __ec = pthread_key_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
+#ifndef _LIBCPP_NO_EXCEPTIONS
if (__ec)
throw system_error(error_code(__ec, system_category()),
"__thread_specific_ptr construction failed");
+#endif
}
template <class _Tp>
@@ -173,8 +175,8 @@ __thread_specific_ptr<_Tp>::reset(pointer __p)
delete __p_old;
}
-class _LIBCPP_VISIBLE thread;
-class _LIBCPP_VISIBLE __thread_id;
+class _LIBCPP_TYPE_VIS thread;
+class _LIBCPP_TYPE_VIS __thread_id;
namespace this_thread
{
@@ -183,10 +185,10 @@ _LIBCPP_INLINE_VISIBILITY __thread_id get_id() _NOEXCEPT;
} // this_thread
-class _LIBCPP_VISIBLE __thread_id;
-template<> struct _LIBCPP_VISIBLE hash<__thread_id>;
+class _LIBCPP_TYPE_VIS __thread_id;
+template<> struct _LIBCPP_TYPE_VIS hash<__thread_id>;
-class _LIBCPP_VISIBLE __thread_id
+class _LIBCPP_TYPE_VIS __thread_id
{
// FIXME: pthread_t is a pointer on Darwin but a long on Linux.
// NULL is the no-thread value on Darwin. Someone needs to check
@@ -228,12 +230,12 @@ private:
__thread_id(pthread_t __id) : __id_(__id) {}
friend __thread_id this_thread::get_id() _NOEXCEPT;
- friend class _LIBCPP_VISIBLE thread;
- friend struct _LIBCPP_VISIBLE hash<__thread_id>;
+ friend class _LIBCPP_TYPE_VIS thread;
+ friend struct _LIBCPP_TYPE_VIS hash<__thread_id>;
};
template<>
-struct _LIBCPP_VISIBLE hash<__thread_id>
+struct _LIBCPP_TYPE_VIS hash<__thread_id>
: public unary_function<__thread_id, size_t>
{
_LIBCPP_INLINE_VISIBILITY
@@ -255,7 +257,7 @@ get_id() _NOEXCEPT
} // this_thread
-class _LIBCPP_VISIBLE thread
+class _LIBCPP_TYPE_VIS thread
{
pthread_t __t_;
@@ -326,7 +328,7 @@ __thread_specific_ptr<__thread_struct>& __thread_local_data();
template <class _Fp, class ..._Args, size_t ..._Indices>
inline _LIBCPP_INLINE_VISIBILITY
void
-__threaad_execute(tuple<_Fp, _Args...>& __t, __tuple_indices<_Indices...>)
+__thread_execute(tuple<_Fp, _Args...>& __t, __tuple_indices<_Indices...>)
{
__invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
}
@@ -338,7 +340,7 @@ __thread_proxy(void* __vp)
__thread_local_data().reset(new __thread_struct);
std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index;
- __threaad_execute(*__p, _Index());
+ __thread_execute(*__p, _Index());
return nullptr;
}