mailing list of musl libc
 help / color / mirror / code / Atom feed
* process doesn't terminate when closing streams from another thread
@ 2015-09-06 14:44 Nuno Gonçalves
  2015-09-06 17:00 ` Szabolcs Nagy
  2015-09-09  4:47 ` Rich Felker
  0 siblings, 2 replies; 4+ messages in thread
From: Nuno Gonçalves @ 2015-09-06 14:44 UTC (permalink / raw)
  To: musl

I'm having problems when closing streams from another thread.

The following code:

static void *func(void *arg)
{
   fclose(stdout);
   fprintf(stderr,"Thread about to exit\n");
   return 0;
}

int main(int argc, char **argv)
{
   int thread_id;
   pthread_create(&thread_id,NULL,&func,NULL);
   pthread_join(thread_id,NULL);
   fprintf(stderr,"Process about to terminate\n");
   return 0;
}

Prints:

root@OpenWrt:/tmp# ./myapp_withmusl
Thread about to exit
Process about to terminate

But never returns! I have to send it a SIGINT.

This happens on target-mips_34kc_musl-1.1.11.

Thanks,
Nuno


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-09  4:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-06 14:44 process doesn't terminate when closing streams from another thread Nuno Gonçalves
2015-09-06 17:00 ` Szabolcs Nagy
2015-09-07  4:50   ` Rich Felker
2015-09-09  4:47 ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).