]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/valgrind/src/valgrind-3.6.0-svn/none/tests/manythreads.c
Inital import
[l4.git] / l4 / pkg / valgrind / src / valgrind-3.6.0-svn / none / tests / manythreads.c
1 /* Make sure there are no thread lifetime related leaks... */
2 #include <pthread.h>
3 #include <stdio.h>
4
5 static void *func(void *v)
6 {
7         return NULL;
8 }
9
10 int main()
11 {
12         int i;
13
14         for(i = 0; i < 10000; i++) {
15                 pthread_t th;
16
17                 if (i > 0 && i % 1000 == 0)
18                         printf("%d...\n", i);
19
20                 pthread_create(&th, NULL, func, NULL);
21                 pthread_join(th, NULL);
22         }
23
24         return 0;
25 }