+2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * linux-low.c (delete_lwp_callback): Remove.
+ (linux_mourn): Use for_each_thread.
+
2017-12-02 Simon Marchi <simon.marchi@polymtl.ca>
* linux-low.c (linux_detach_lwp_callback): Return void, remove
/* Remove all LWPs that belong to process PROC from the lwp list. */
-static int
-delete_lwp_callback (thread_info *thread, void *proc)
-{
- struct lwp_info *lwp = get_thread_lwp (thread);
- struct process_info *process = (struct process_info *) proc;
-
- if (pid_of (thread) == pid_of (process))
- delete_lwp (lwp);
-
- return 0;
-}
-
static void
linux_mourn (struct process_info *process)
{
thread_db_mourn (process);
#endif
- find_inferior (&all_threads, delete_lwp_callback, process);
+ for_each_thread (process->pid, [] (thread_info *thread)
+ {
+ delete_lwp (get_thread_lwp (thread));
+ });
/* Freeing all private data. */
priv = process->priv;