diff options
author | Tom Tromey <tom@tromey.com> | 2025-02-25 07:56:55 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2025-03-11 08:39:58 -0600 |
commit | 58984e4ad22ac8bb8774b338625595ad9f6f55e9 (patch) | |
tree | 7136dbef89ee0cb08a72ab01adae76d410467980 /gdb/thread.c | |
parent | d8a30dd2a692053165ff3dfad1e93164180fc974 (diff) | |
download | binutils-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.c | 5 |
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; |