update thread list, delete exited threads
[deliverable/binutils-gdb.git] / gdb / thread.c
index ec398f578d2f97e05d0147139af179e21a6765b1..80c87050df9b176429cba7b0262c2a10611b6df6 100644 (file)
@@ -625,16 +625,29 @@ thread_alive (struct thread_info *tp)
 void
 prune_threads (void)
 {
-  struct thread_info *tp, *next;
+  struct thread_info *tp, *tmp;
 
-  for (tp = thread_list; tp; tp = next)
+  ALL_THREADS_SAFE (tp, tmp)
     {
-      next = tp->next;
       if (!thread_alive (tp))
        delete_thread (tp->ptid);
     }
 }
 
+/* See gdbthreads.h.  */
+
+void
+delete_exited_threads (void)
+{
+  struct thread_info *tp, *tmp;
+
+  ALL_THREADS_SAFE (tp, tmp)
+    {
+      if (tp->state == THREAD_EXITED)
+       delete_thread (tp->ptid);
+    }
+}
+
 /* Disable storing stack temporaries for the thread whose id is
    stored in DATA.  */
 
This page took 0.024586 seconds and 4 git commands to generate.