aboutsummaryrefslogtreecommitdiff
path: root/gdb/thread.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2025-02-25 07:56:55 -0700
committerTom Tromey <tom@tromey.com>2025-03-11 08:39:58 -0600
commit58984e4ad22ac8bb8774b338625595ad9f6f55e9 (patch)
tree7136dbef89ee0cb08a72ab01adae76d410467980 /gdb/thread.c
parentd8a30dd2a692053165ff3dfad1e93164180fc974 (diff)
downloadbinutils-58984e4ad22ac8bb8774b338625595ad9f6f55e9.zip
binutils-58984e4ad22ac8bb8774b338625595ad9f6f55e9.tar.gz
binutils-58984e4ad22ac8bb8774b338625595ad9f6f55e9.tar.bz2
Use gdb::function_view in iterate_over_threads
This C++-ifies iterate_over_threads, changing it to accept a gdb::function_view and to return bool. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/thread.c')
-rw-r--r--gdb/thread.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/thread.c b/gdb/thread.c
index 5892b15..8a34671 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -602,11 +602,10 @@ find_thread_by_handle (gdb::array_view<const gdb_byte> handle,
*/
struct thread_info *
-iterate_over_threads (int (*callback) (struct thread_info *, void *),
- void *data)
+iterate_over_threads (gdb::function_view<bool (struct thread_info *)> callback)
{
for (thread_info *tp : all_threads_safe ())
- if ((*callback) (tp, data))
+ if (callback (tp))
return tp;
return NULL;