#if (!defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS) \
|| defined(__native_client__)) && !defined(SKIP_THREADKEY_TEST)
/* FIXME: Skip this test on Solaris for now. The test may fail on */
/* other targets as well. Currently, tested only on Linux, Cygwin */
/* and Darwin. */
# define SKIP_THREADKEY_TEST
#endif
#ifdef SKIP_THREADKEY_TEST
int main(void)
{
printf("threadkey_test skipped\n");
return 0;
}
#define NTHREADS_INNER (NTHREADS * 6) /* number of threads to create */
int main(void)
{
int i;
GC_INIT();
if (GC_get_find_leak())
printf("This test program is not designed for leak detection mode\n");
# ifdef GC_SOLARIS_THREADS
make_key();
# else
pthread_once (&key_once, make_key);
# endif
for (i = 0; i < NTHREADS_INNER; i++) {
pthread_t t;
if (GC_pthread_create(&t, NULL, entry, NULL) == 0) {
void *res;
int code = (i & 1) != 0 ? GC_pthread_join(t, &res)
: GC_pthread_detach(t);