Remove usage of find_inferior in iterate_over_lwps
[deliverable/binutils-gdb.git] / gdb / gdbserver / gdbthread.h
index b82d5b0e72ac8ca9673c24046dd62aa2ebb4517e..df1e4778de661ac3cec23c6e300111a572b0c731 100644 (file)
@@ -123,6 +123,18 @@ find_thread (int pid, Func func)
     });
 }
 
+/* Find the first thread that matches FILTER for which FUNC returns true.
+   Return NULL if no thread satisfying these conditions is found.  */
+
+template <typename Func>
+static thread_info *
+find_thread (ptid_t filter, Func func)
+{
+  return find_thread ([&] (thread_info *thread) {
+    return thread->id.matches (filter) && func (thread);
+  });
+}
+
 /* Invoke FUNC for each thread.  */
 
 template <typename Func>
This page took 0.025854 seconds and 4 git commands to generate.