]> git.ipfire.org Git - thirdparty/glibc.git/blob - linuxthreads/Examples/ex16.c
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
[thirdparty/glibc.git] / linuxthreads / Examples / ex16.c
1 /* Tst case by Jakub Jelinek <jakub@redhat.com>. */
2 #include <stdlib.h>
3 #include <unistd.h>
4 #include <pthread.h>
5
6 static void *
7 task (void *p)
8 {
9 sleep (30);
10 return NULL;
11 }
12
13 int
14 main (void)
15 {
16 pthread_t t;
17 int status;
18
19 status = pthread_create (&t, NULL, task, NULL);
20 if (status)
21 exit (status);
22
23 status = pthread_detach (t);
24 pthread_kill_other_threads_np ();
25 return status;
26 }