]> granicus.if.org Git - gc/commitdiff
2009-09-29 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Tue, 29 Sep 2009 18:33:22 +0000 (18:33 +0000)
committerguest <ivmai@mail.ru>
Fri, 29 Jul 2011 11:31:22 +0000 (15:31 +0400)
* solaris_threads.c (GC_thr_daemon): Don't crash if GC_lookup_thread () returns
NULL.

svn path=/trunk/mono/; revision=142912

ChangeLog
solaris_threads.c

index a30d4a33ae935cce32aa8a598ee99d5fd0e056ed..661feb8a64840686cd10e65419b8d74c4b5fb526 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-09-29  Zoltan Varga  <vargaz@gmail.com>
+
+       * solaris_threads.c (GC_thr_daemon): Don't crash if GC_lookup_thread () returns
+       NULL.
+
 2009-09-25  Zoltan Varga  <vargaz@gmail.com>
 
        * solaris_threads.c (GC_get_orig_stack_size): Remove the annoying 'Large stack
index f0ae894eebae7fe9838830a715bc5dd403cf0272..a0321b157e4c440ea9eec2395a3c55da86393980 100644 (file)
@@ -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();
        }
     }