aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-low.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-11-19 22:23:24 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2017-11-19 22:23:24 -0500
commit139720c5b32963ce52c5f691e179920ff84a2237 (patch)
treef085d5585dcf8cc3da9ab740ad11a94765886040 /gdb/gdbserver/linux-low.c
parent6d1e5673fec830f0f1c86632a5d9333e34582bb3 (diff)
downloadgdb-139720c5b32963ce52c5f691e179920ff84a2237.zip
gdb-139720c5b32963ce52c5f691e179920ff84a2237.tar.gz
gdb-139720c5b32963ce52c5f691e179920ff84a2237.tar.bz2
Remove usage of find_inferior in unsuspend_all_lwps
Replace with for_each_thread. I inlined unsuspend_one_lwp in unsuspend_all_lwps, since it is very simple. gdb/gdbserver/ChangeLog: * linux-low.c (unsuspend_one_lwp): Remove. (unsuspend_all_lwps): Use for_each_thread, inline code from unsuspend_one_lwp.
Diffstat (limited to 'gdb/gdbserver/linux-low.c')
-rw-r--r--gdb/gdbserver/linux-low.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index fd8e45e..fce3fd0 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -2969,28 +2969,19 @@ select_event_lwp (struct lwp_info **orig_lp)
}
}
-/* Decrement the suspend count of an LWP. */
-
-static int
-unsuspend_one_lwp (thread_info *thread, void *except)
-{
- struct lwp_info *lwp = get_thread_lwp (thread);
-
- /* Ignore EXCEPT. */
- if (lwp == except)
- return 0;
-
- lwp_suspended_decr (lwp);
- return 0;
-}
-
/* Decrement the suspend count of all LWPs, except EXCEPT, if non
NULL. */
static void
unsuspend_all_lwps (struct lwp_info *except)
{
- find_inferior (&all_threads, unsuspend_one_lwp, except);
+ for_each_thread ([&] (thread_info *thread)
+ {
+ lwp_info *lwp = get_thread_lwp (thread);
+
+ if (lwp != except)
+ lwp_suspended_decr (lwp);
+ });
}
static void move_out_of_jump_pad_callback (thread_info *thread);