summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorivmai <ivmai>2011-05-17 10:59:42 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:06:59 +0200
commit77ffb1ff58523f4ee461e1d1ae1a1ae1ddd9b601 (patch)
treecd94370e23c830020d44e5802f4bc3b0ec74cfd1 /tests
parentd6f2674f15e848495b2ed9db1689e425cd2e1115 (diff)
2011-05-17 Ivan Maidanski <ivmai@mail.ru>
* pthread_support.c (pthread_join): Add assertion (check thread is finished). * pthread_support.c (GC_register_my_thread): Don't detach the thread if invoked from the thread destructor. * win32_threads.c (GC_register_my_thread): Ditto. * win32_threads.c (GC_unregister_my_thread): Don't delete the thread (just set FINISHED) if the thread is not detached (only if GC_PTHREADS); add assertion (check the thread is not finished). * tests/threadkey_test.c (main): Join some created threads.
Diffstat (limited to 'tests')
-rw-r--r--tests/threadkey_test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/threadkey_test.c b/tests/threadkey_test.c
index 0ae94bb..1ea761d 100644
--- a/tests/threadkey_test.c
+++ b/tests/threadkey_test.c
@@ -61,7 +61,10 @@ int main (void)
# endif
for (i = 0; i < LIMIT; i++) {
pthread_t t;
- GC_pthread_create (&t, NULL, entry, NULL);
+ void *res;
+ if (GC_pthread_create (&t, NULL, entry, NULL) == 0
+ && (i & 1) != 0)
+ GC_pthread_join (t, &res);
}
return 0;
}