[hurd,commited] htl: Fix mt-safeness of libio

Samuel Thibault <[email protected]>
Newsgroups gmane.os.hurd.cvs,gmane.comp.lib.glibc.alpha
Message-ID <[email protected]>
Since d2e04918833 ("Single threaded stdio optimization")
we are supposed to call _IO_enable_locks when creating the first thread,
but that commit missed doing it for htl.
---
 htl/pt-create.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/htl/pt-create.c b/htl/pt-create.c
index ef9e411f22..2a43285372 100644
--- a/htl/pt-create.c
+++ b/htl/pt-create.c
@@ -27,6 +27,7 @@
 #include <sys/single_threaded.h>
 #include <shlib-compat.h>
 #include <ldsodefs.h>
+#include <libioP.h>
 
 #include <pt-internal.h>
 #include <pthreadP.h>
@@ -250,6 +251,9 @@ __pthread_create_internal (struct __pthread **thread,
      avoid calling pthread_self), read it before starting the thread.  */
   *thread = pthread;
 
+  if (start_routine)
+    _IO_enable_locks ();
+
   /* Schedule the new thread.  */
   err = __pthread_thread_start (pthread);
   if (err)
-- 
2.51.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.