as exited and do the notification. */
extern void delete_thread (struct thread_info *thread);
+/* Like delete_thread, but be quiet about it. Used when the process
+ this thread belonged to has already exited, for example. */
+extern void delete_thread_silent (struct thread_info *thread);
+
/* Mark the thread exited, but don't delete it or remove it from the
inferior thread list. */
extern void set_thread_exited (thread_info *tp, bool silent);
global_thread_step_over_list.erase (it);
}
-/* See gdbthread.h. */
+/* Delete the thread referenced by THR. If SILENT, don't notify
+ the observer of this exit.
+
+ THR must not be NULL or a failed assertion will be raised. */
-void
-delete_thread (thread_info *thr)
+static void
+delete_thread_1 (thread_info *thr, bool silent)
{
gdb_assert (thr != nullptr);
- threads_debug_printf ("deleting thread %s", thr->ptid.to_string ().c_str ());
+ threads_debug_printf ("deleting thread %s, silent = %d",
+ thr->ptid.to_string ().c_str (), silent);
- set_thread_exited (thr, false);
+ set_thread_exited (thr, silent);
if (!thr->deletable ())
{
delete thr;
}
+/* See gdbthread.h. */
+
+void
+delete_thread (thread_info *thread)
+{
+ delete_thread_1 (thread, false /* not silent */);
+}
+
+void
+delete_thread_silent (thread_info *thread)
+{
+ delete_thread_1 (thread, true /* silent */);
+}
+
struct thread_info *
find_thread_global_id (int global_id)
{