~ubuntu-branches/ubuntu/trusty/libc++/trusty

« back to all changes in this revision

Viewing changes to libcxx/include/thread

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-04-24 09:32:41 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130424093241-80ospffb33lml11k
Tags: 1.0~svn180177-1~exp1
* New upstream release
* Minimal clang version (>= 3.2)
* Standards-Version updated to version 3.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
__thread_specific_ptr<_Tp>::__thread_specific_ptr()
145
145
{
146
146
    int __ec = pthread_key_create(&__key_, &__thread_specific_ptr::__at_thread_exit);
 
147
#ifndef _LIBCPP_NO_EXCEPTIONS
147
148
    if (__ec)
148
149
        throw system_error(error_code(__ec, system_category()),
149
150
                           "__thread_specific_ptr construction failed");
 
151
#endif
150
152
}
151
153
 
152
154
template <class _Tp>
173
175
    delete __p_old;
174
176
}
175
177
 
176
 
class _LIBCPP_VISIBLE thread;
177
 
class _LIBCPP_VISIBLE __thread_id;
 
178
class _LIBCPP_TYPE_VIS thread;
 
179
class _LIBCPP_TYPE_VIS __thread_id;
178
180
 
179
181
namespace this_thread
180
182
{
183
185
 
184
186
}  // this_thread
185
187
 
186
 
class _LIBCPP_VISIBLE __thread_id;
187
 
template<> struct _LIBCPP_VISIBLE hash<__thread_id>;
 
188
class _LIBCPP_TYPE_VIS __thread_id;
 
189
template<> struct _LIBCPP_TYPE_VIS hash<__thread_id>;
188
190
 
189
 
class _LIBCPP_VISIBLE __thread_id
 
191
class _LIBCPP_TYPE_VIS __thread_id
190
192
{
191
193
    // FIXME: pthread_t is a pointer on Darwin but a long on Linux.
192
194
    // NULL is the no-thread value on Darwin.  Someone needs to check
228
230
    __thread_id(pthread_t __id) : __id_(__id) {}
229
231
 
230
232
    friend __thread_id this_thread::get_id() _NOEXCEPT;
231
 
    friend class _LIBCPP_VISIBLE thread;
232
 
    friend struct _LIBCPP_VISIBLE hash<__thread_id>;
 
233
    friend class _LIBCPP_TYPE_VIS thread;
 
234
    friend struct _LIBCPP_TYPE_VIS hash<__thread_id>;
233
235
};
234
236
 
235
237
template<>
236
 
struct _LIBCPP_VISIBLE hash<__thread_id>
 
238
struct _LIBCPP_TYPE_VIS hash<__thread_id>
237
239
    : public unary_function<__thread_id, size_t>
238
240
{
239
241
    _LIBCPP_INLINE_VISIBILITY
255
257
 
256
258
}  // this_thread
257
259
 
258
 
class _LIBCPP_VISIBLE thread
 
260
class _LIBCPP_TYPE_VIS thread
259
261
{
260
262
    pthread_t __t_;
261
263
 
326
328
template <class _Fp, class ..._Args, size_t ..._Indices>
327
329
inline _LIBCPP_INLINE_VISIBILITY
328
330
void
329
 
__threaad_execute(tuple<_Fp, _Args...>& __t, __tuple_indices<_Indices...>)
 
331
__thread_execute(tuple<_Fp, _Args...>& __t, __tuple_indices<_Indices...>)
330
332
{
331
333
    __invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
332
334
}
338
340
    __thread_local_data().reset(new __thread_struct);
339
341
    std::unique_ptr<_Fp> __p(static_cast<_Fp*>(__vp));
340
342
    typedef typename __make_tuple_indices<tuple_size<_Fp>::value, 1>::type _Index;
341
 
    __threaad_execute(*__p, _Index());
 
343
    __thread_execute(*__p, _Index());
342
344
    return nullptr;
343
345
}
344
346