]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/tools/build/src/engine/boehm_gc/tests/thread_leak_test.c
3 #endif /* GC_THREADS */
4 #include "leak_detector.h"
8 void * test(void * arg
) {
11 GC_find_leak
= 1; /* for new collect versions not compiled */
12 /* with -DFIND_LEAK. */
13 for (i
= 0; i
< 10; ++i
) {
14 p
[i
] = malloc(sizeof(int)+i
);
17 for (i
= 1; i
< 10; ++i
) {
27 pthread_t t
[NTHREADS
];
31 for (i
= 0; i
< NTHREADS
; ++i
) {
32 if ((code
= pthread_create(t
+ i
, 0, test
, 0)) != 0) {
33 printf("Thread creation failed %d\n", code
);
36 for (i
= 0; i
< NTHREADS
; ++i
) {
37 if ((code
= pthread_join(t
[i
], 0)) != 0) {
38 printf("Thread join failed %lu\n", code
);