Reapply: List inferiors/threads/pspaces in ascending order
[deliverable/binutils-gdb.git] / gdb / thread.c
index 29fc610e96e7dc097363d14f6a99455fa9a024a1..4c2259f7928af6c8a81b075aab54aa7091af115f 100644 (file)
@@ -236,8 +236,17 @@ new_thread (ptid_t ptid)
 
   tp->ptid = ptid;
   tp->num = ++highest_thread_num;
-  tp->next = thread_list;
-  thread_list = tp;
+
+  if (thread_list == NULL)
+    thread_list = tp;
+  else
+    {
+      struct thread_info *last;
+
+      for (last = thread_list; last->next != NULL; last = last->next)
+       ;
+      last->next = tp;
+    }
 
   /* Nothing to follow yet.  */
   tp->pending_follow.kind = TARGET_WAITKIND_SPURIOUS;
This page took 0.023422 seconds and 4 git commands to generate.