- param.remote = this;
- param.input = context;
- param.output = NULL;
- QUEUE_iterate (stop_reply_p, get_remote_state ()->stop_reply_queue,
- remove_child_of_pending_fork, ¶m);
-}
-
-/* Callback data for
- check_pending_event_prevents_wildcard_vcont_callback. */
-struct check_pending_event_prevents_wildcard_vcont_callback_data
-{
- /* The remote target. */
- remote_target *remote;
-
- /* Whether we can do a global wildcard (vCont;c) */
- int *may_global_wildcard_vcont;
-};
-
-/* Check whether EVENT would prevent a global or process wildcard
- vCont action. */
-
-static int
-check_pending_event_prevents_wildcard_vcont_callback
- (QUEUE (stop_reply_p) *q,
- QUEUE_ITER (stop_reply_p) *iter,
- stop_reply_p event,
- void *data)
-{
- struct inferior *inf;
- auto *cb_data = (check_pending_event_prevents_wildcard_vcont_callback_data *) data;
-
- if (event->ws.kind == TARGET_WAITKIND_NO_RESUMED
- || event->ws.kind == TARGET_WAITKIND_NO_HISTORY)
- return 1;
-
- if (event->ws.kind == TARGET_WAITKIND_FORKED
- || event->ws.kind == TARGET_WAITKIND_VFORKED)
- *cb_data->may_global_wildcard_vcont = 0;
-
- inf = find_inferior_ptid (event->ptid);
-
- /* This may be the first time we heard about this process.
- Regardless, we must not do a global wildcard resume, otherwise
- we'd resume this process too. */
- *cb_data->may_global_wildcard_vcont = 0;
- if (inf != NULL)
- get_remote_inferior (inf)->may_wildcard_vcont = false;
-
- return 1;
+ for (auto &event : get_remote_state ()->stop_reply_queue)
+ if (event->ws.kind == TARGET_WAITKIND_FORKED
+ || event->ws.kind == TARGET_WAITKIND_VFORKED
+ || event->ws.kind == TARGET_WAITKIND_THREAD_EXITED)
+ context->remove_thread (event->ws.value.related_pid);