diff options
| author | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-07 03:07:45 +0000 |
|---|---|---|
| committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2017-01-07 03:07:45 +0000 |
| commit | 6d7d0bec105fdc0da092745984386a45b3ee3c90 (patch) | |
| tree | 5628730a4071e0def40a4a07c5c14ec92d4b237b /libcxx/include/thread | |
| parent | cd71f447b7d33689b6149e7f5ef2f1f79aaee157 (diff) | |
| download | bcm5719-llvm-6d7d0bec105fdc0da092745984386a45b3ee3c90.tar.gz bcm5719-llvm-6d7d0bec105fdc0da092745984386a45b3ee3c90.zip | |
provide Win32 native threading
Add an implementation for the Win32 threading model as a backing API for
the internal c++ threading interfaces. This uses the Fls* family for
the TLS (which has the support for adding termination callbacks),
CRITICAL_SECTIONs for the recursive mutex, and Slim Reader/Writer locks
(SRW locks) for non-recursive mutexes. These APIs should all be
available on Vista or newer.
llvm-svn: 291333
Diffstat (limited to 'libcxx/include/thread')
| -rw-r--r-- | libcxx/include/thread | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/libcxx/include/thread b/libcxx/include/thread index b5b96e8c71e..479e3c08f80 100644 --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -148,7 +148,8 @@ class __thread_specific_ptr __thread_specific_ptr(const __thread_specific_ptr&); __thread_specific_ptr& operator=(const __thread_specific_ptr&); - static void __at_thread_exit(void*); + static void _LIBCPP_TLS_DESTRUCTOR_CC __at_thread_exit(void*); + public: typedef _Tp* pointer; @@ -164,7 +165,7 @@ public: }; template <class _Tp> -void +void _LIBCPP_TLS_DESTRUCTOR_CC __thread_specific_ptr<_Tp>::__at_thread_exit(void* __p) { delete static_cast<pointer>(__p); @@ -173,12 +174,10 @@ __thread_specific_ptr<_Tp>::__at_thread_exit(void* __p) template <class _Tp> __thread_specific_ptr<_Tp>::__thread_specific_ptr() { - int __ec = __libcpp_tls_create( - &__key_, - &__thread_specific_ptr::__at_thread_exit); - if (__ec) - __throw_system_error(__ec, - "__thread_specific_ptr construction failed"); + int __ec = + __libcpp_tls_create(&__key_, &__thread_specific_ptr::__at_thread_exit); + if (__ec) + __throw_system_error(__ec, "__thread_specific_ptr construction failed"); } template <class _Tp> |

