diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2014-08-13 19:40:10 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2014-08-13 19:40:10 +0100 |
commit | c6b3f349f5ec77b0d91c1105dad4a4138c9aa0ba (patch) | |
tree | c392e014c949123a3926cb7b947751e628c2c887 /libstdc++-v3/include | |
parent | d2f2e467c03f108a407473366c950bc2371ca00a (diff) | |
download | gcc-c6b3f349f5ec77b0d91c1105dad4a4138c9aa0ba.zip gcc-c6b3f349f5ec77b0d91c1105dad4a4138c9aa0ba.tar.gz gcc-c6b3f349f5ec77b0d91c1105dad4a4138c9aa0ba.tar.bz2 |
re PR libstdc++/61841 (broken std::thread on Hurd)
PR libstdc++/61841
* include/std/thread (thread::_M_start_thread): Declare new overload.
(thread::thread<_Callable, _Args...>): Call new overload with an
explicit reference to pthread_create.
* src/c++11/thread.cc (thread::_M_start_thread): Add new overload.
* config/abi/pre/gnu.ver: Export new function.
From-SVN: r213922
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/std/thread | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/thread b/libstdc++-v3/include/std/thread index efcb101..0576347 100644 --- a/libstdc++-v3/include/std/thread +++ b/libstdc++-v3/include/std/thread @@ -132,9 +132,17 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION explicit thread(_Callable&& __f, _Args&&... __args) { +#ifdef GTHR_ACTIVE_PROXY + // Create a reference to pthread_create, not just the gthr weak symbol + _M_start_thread(_M_make_routine(std::__bind_simple( + std::forward<_Callable>(__f), + std::forward<_Args>(__args)...)), + reinterpret_cast<void(*)()>(&pthread_create)); +#else _M_start_thread(_M_make_routine(std::__bind_simple( std::forward<_Callable>(__f), std::forward<_Args>(__args)...))); +#endif } ~thread() @@ -183,6 +191,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION private: void + _M_start_thread(__shared_base_type, void (*)()); + + void _M_start_thread(__shared_base_type); template<typename _Callable> |