Back to index

glibc  2.9
ex16.c
Go to the documentation of this file.
00001 /* Tst case by Jakub Jelinek <jakub@redhat.com>.  */
00002 #include <stdlib.h>
00003 #include <unistd.h>
00004 #include <pthread.h>
00005 
00006 static void *
00007 task (void *p)
00008 {
00009   sleep (30);
00010   return NULL;
00011 }
00012 
00013 int
00014 main (void)
00015 {
00016   pthread_t t;
00017   int status;
00018 
00019   status = pthread_create (&t, NULL, task, NULL);
00020   if (status)
00021     exit (status);
00022 
00023   status = pthread_detach (t);
00024   pthread_kill_other_threads_np ();
00025   return status;
00026 }