1 #define GC_LINUX_THREADS
2 #include "leak_detector.h"
6 void * test(void * arg
) {
9 GC_find_leak
= 1; /* for new collect versions not compiled */
10 /* with -DFIND_LEAK. */
11 for (i
= 0; i
< 10; ++i
) {
12 p
[i
] = malloc(sizeof(int)+i
);
15 for (i
= 1; i
< 10; ++i
) {
24 pthread_t t
[NTHREADS
];
27 for (i
= 0; i
< NTHREADS
; ++i
) {
28 if ((code
= pthread_create(t
+ i
, 0, test
, 0)) != 0) {
29 printf("Thread creation failed %d\n", code
);
32 for (i
= 0; i
< NTHREADS
; ++i
) {
33 if ((code
= pthread_join(t
[i
], 0)) != 0) {
34 printf("Thread join failed %lu\n", code
);