public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [hurd, commited] hurd: initialize libpthread before starting the signal thread
@ 2020-11-13  1:24 Samuel Thibault
  0 siblings, 0 replies; only message in thread
From: Samuel Thibault @ 2020-11-13  1:24 UTC (permalink / raw)
  To: libc-alpha; +Cc: Samuel Thibault, commit-hurd

We cannot rely on csu calling __pthread_initialize_minimal before
posixland_init, in some cases _init gets called before that.
---
 hurd/hurdinit.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hurd/hurdinit.c b/hurd/hurdinit.c
index 06a2d3b7fd..7faa51b352 100644
--- a/hurd/hurdinit.c
+++ b/hurd/hurdinit.c
@@ -21,6 +21,7 @@
 #include <unistd.h>
 #include <hurd.h>
 #include <hurd/port.h>
+#include <ldsodefs.h>
 #include "set-hooks.h"
 #include "hurdmalloc.h"		/* XXX */
 
@@ -116,6 +117,11 @@ _hurd_libc_proc_init (char **argv)
 {
   if (_hurd_portarray)
     {
+      /* We will start the signal thread, so we need to initialize libpthread
+       * if linked in.  */
+      if (__pthread_initialize_minimal != NULL)
+	__pthread_initialize_minimal ();
+
       /* Tell the proc server we exist, if it does.  */
       if (_hurd_portarray[INIT_PORT_PROC] != MACH_PORT_NULL)
 	_hurd_new_proc_init (argv, _hurd_intarray, _hurd_intarraysize);
-- 
2.28.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-13  1:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-13  1:24 [hurd, commited] hurd: initialize libpthread before starting the signal thread Samuel Thibault

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).