summaryrefslogtreecommitdiff
path: root/tests/test.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-01-12 07:25:56 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-01-12 11:26:42 +0400
commitebad007ca2ee03800ccad740512bcbeec07439c2 (patch)
tree748baf1c42c4d61cb2bc66d568978ba6127d6332 /tests/test.c
parent83c1eecd037ff4d3e3d19615ced970f566f5cc72 (diff)
downloadbdwgc-ebad007ca2ee03800ccad740512bcbeec07439c2.tar.gz
Improve GC_thread_is_registered implementation and testing
* pthread_support.c (GC_thread_is_registered): Call pthread_self outside LOCK; add DCL_LOCK_STATE declaration; replace "ptr" local variable with "GC_thread me" (and remove cast). * win32_threads.c (GC_thread_is_registered): Fix implementation by calling GC_lookup_thread_inner (now works the same as in pthread_support.c). * tests/test.c (run_one_test): Test GC_thread_is_registered (only if THREADS).
Diffstat (limited to 'tests/test.c')
-rw-r--r--tests/test.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/test.c b/tests/test.c
index 9125e750..ca7c6d42 100644
--- a/tests/test.c
+++ b/tests/test.c
@@ -1078,6 +1078,12 @@ void run_one_test(void)
GC_printf("Expect lots of problems\n");
# endif
GC_FREE(0);
+# ifdef THREADS
+ if (!GC_thread_is_registered()) {
+ GC_printf("Current thread is not registered with GC\n");
+ FAIL;
+ }
+# endif
# ifndef DBG_HDRS_ALL
collectable_count += 3;
if ((GC_size(GC_malloc(7)) != 8 &&