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.
#include <sys/single_threaded.h>
#include <shlib-compat.h>
#include <ldsodefs.h>
+#include <libioP.h>
#include <pt-internal.h>
#include <pthreadP.h>
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)