summaryrefslogtreecommitdiff
path: root/pthread_support.c
diff options
context:
space:
mode:
authorivmai <ivmai>2011-07-05 18:35:22 +0200
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 19:07:00 +0200
commitd0f043893c60075690a974e41901fb7a878cad3d (patch)
tree7176ec0869814ef4937a4b8a090745d98222d6c2 /pthread_support.c
parentaaa06557570bc020a988353019e799b8d0d16943 (diff)
2011-07-05 Ivan Maidanski <ivmai@mail.ru>
* malloc.c (GC_init_lib_bounds): Call GC_init (to ensure GC is initialized before doing GC_text_mapping). * misc.c (GC_init): Add a check for GC_init recursion in case of malloc is redirected (abort with the corresponding message). * pthread.c (GC_thr_init): Place GC_add_roots_inner call into "else" branch to prevent "local variable might be uninitialized" compiler warning; add comment.
Diffstat (limited to 'pthread_support.c')
-rw-r--r--pthread_support.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pthread_support.c b/pthread_support.c
index f9af302..7e7e291 100644
--- a/pthread_support.c
+++ b/pthread_support.c
@@ -906,8 +906,10 @@ GC_INNER void GC_thr_init(void)
if (!GC_enclosing_mapping(thread_local_addr, &main_thread_start,
&main_thread_end)) {
ABORT("Failed to find mapping for main thread thread locals");
+ } else {
+ /* main_thread_start and main_thread_end are initialized. */
+ GC_add_roots_inner(main_thread_start, main_thread_end, FALSE);
}
- GC_add_roots_inner(main_thread_start, main_thread_end, FALSE);
}
# endif
/* Add the initial thread, so we can stop it. */