From: Zoltan Varga Date: Tue, 29 Sep 2009 18:33:22 +0000 (+0000) Subject: 2009-09-29 Zoltan Varga X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8ee927e43bbc5e0cad3f13311f67b1f426336bd;p=gc 2009-09-29 Zoltan Varga * solaris_threads.c (GC_thr_daemon): Don't crash if GC_lookup_thread () returns NULL. svn path=/trunk/mono/; revision=142912 --- diff --git a/ChangeLog b/ChangeLog index a30d4a33..661feb8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-29 Zoltan Varga + + * solaris_threads.c (GC_thr_daemon): Don't crash if GC_lookup_thread () returns + NULL. + 2009-09-25 Zoltan Varga * solaris_threads.c (GC_get_orig_stack_size): Remove the annoying 'Large stack diff --git a/solaris_threads.c b/solaris_threads.c index f0ae894e..a0321b15 100644 --- a/solaris_threads.c +++ b/solaris_threads.c @@ -787,18 +787,20 @@ void * GC_thr_daemon(void * dummy) UNLOCK(); } else { t = GC_lookup_thread(departed); - GC_multithreaded--; - if (!(t -> flags & CLIENT_OWNS_STACK)) { - GC_stack_free(t -> stack, t -> stack_size); - } - if (t -> flags & DETACHED) { - GC_delete_thread(departed); - } else { - t -> status = status; - t -> flags |= FINISHED; - cond_signal(&(t -> join_cv)); - cond_broadcast(&GC_prom_join_cv); - } + GC_multithreaded--; + if (t) { + if (!(t -> flags & CLIENT_OWNS_STACK)) { + GC_stack_free(t -> stack, t -> stack_size); + } + if (t -> flags & DETACHED) { + GC_delete_thread(departed); + } else { + t -> status = status; + t -> flags |= FINISHED; + cond_signal(&(t -> join_cv)); + cond_broadcast(&GC_prom_join_cv); + } + } UNLOCK(); } }