13 #define TST int i, a[2], b[2]; \
14 for (i = 0; i < 2; i++) a[i] = 0; \
15 for (i = 0; i < 2; i++) b[i] = 0
17 static int count
[SIZE
];
19 static void tst1 (jmp_buf loc
)
25 static void tst2(jmp_buf loc
)
34 static void *tst (void * index
)
37 int i
= *(int *) index
;
40 for (v
[i
] = 0; v
[i
] < COUNT
; v
[i
]++) {
41 if (setjmp (loc
) == 0) {
64 for (i
= 0; i
< SIZE
; i
++) {
67 pthread_create (&id
[i
], NULL
, tst
, (void *) &index
[i
]);
69 id
[i
] = CreateThread(NULL
, 8192, (LPTHREAD_START_ROUTINE
) tst
, (void *) &index
[i
], 0, NULL
);
72 for (i
= 0; i
< SIZE
; i
++) {
74 pthread_join (id
[i
], NULL
);
76 WaitForSingleObject(id
[i
], INFINITE
);
79 for (i
= 0; i
< SIZE
; i
++) {
80 if (count
[i
] != COUNT
)
81 printf ("error: %d %d\n", i
, count
[i
]);