none/tests/fdleak_cmsg_supp.supp: Add suppressions for older glibc
[valgrind.git] / none / tests / solaris / threads_exitall.c
blob4899a1ccecfe1850d622779bb0da29e47e7daa6f
1 /* Test that all threads are killed when exit() is called. */
3 #include <pthread.h>
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include <unistd.h>
8 void *thread_proc(void *arg)
10 /* Wait for main thread to block. */
11 sleep(2);
13 /* Exit the program. */
14 exit(0);
16 return NULL;
19 int main(void)
21 pthread_t thread;
22 void *status;
24 if (pthread_create(&thread, NULL, thread_proc, NULL)) {
25 perror("pthread_create");
26 return 1;
29 if (pthread_join(thread, &status)) {
30 perror("pthread_join");
31 return 1;
34 /* This code should not be reached. */
35 fprintf(stderr, "Thread joined\n");
37 return 0;