]> git.ipfire.org Git - thirdparty/gcc.git/commit
link pthread_join from std::thread ctor
authorAlexandre Oliva <oliva@adacore.com>
Fri, 3 Mar 2023 18:59:36 +0000 (15:59 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Fri, 3 Mar 2023 19:06:44 +0000 (16:06 -0300)
commit21edd841611a97442a6b95e8ec7e91ff8fd3a451
tree34a5e4e93347abfb81d949c23d0115bfc2e51c9d
parentfdac2bea53bf5e7214352e2afd5542254c3156cb
link pthread_join from std::thread ctor

Like pthread_create, pthread_join may fail to be statically linked in
absent strong uses, so add to user code strong references to both when
std::thread objects are created.

for  libstdc++-v3/ChangeLog

PR libstdc++/104852
PR libstdc++/95989
PR libstdc++/52590
* include/bits/std_thread.h (thread::_M_thread_deps): New
static implicitly-inline member function.
(std::thread template ctor): Pass it to _M_start_thread.
* src/c++11/thread.cc (thread::_M_start_thread): Name depend
parameter, force it live on entry.
libstdc++-v3/include/bits/std_thread.h
libstdc++-v3/src/c++11/thread.cc