Пример #1
0
static void
nbsd_thread_activate (void)
{
  nbsd_thread_active = 1;
  main_ptid = inferior_ptid;
  cached_thread = minus_one_ptid;
  thread_change_ptid(inferior_ptid,
      ptid_build (ptid_get_pid (inferior_ptid), 1, 0));
  nbsd_update_thread_list (NULL);
  inferior_ptid = find_active_thread ();
}
Пример #2
0
static void
hpux_thread_create_inferior (char *exec_file, char *allargs, char **env,
                             int from_tty)
{
    deprecated_child_ops.to_create_inferior (exec_file, allargs, env, from_tty);

    if (hpux_thread_active)
    {
        main_ptid = inferior_ptid;

        push_target (&hpux_thread_ops);

        inferior_ptid = find_active_thread ();

        add_thread (inferior_ptid);
    }
}
Пример #3
0
static ptid_t
hpux_thread_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
{
    ptid_t rtnval;
    struct cleanup *old_chain;

    old_chain = save_inferior_ptid ();

    inferior_ptid = main_ptid;

    if (!ptid_equal (ptid, minus_one_ptid))
        ptid = main_ptid;

    rtnval = deprecated_child_ops.to_wait (ptid, ourstatus);

    rtnval = find_active_thread ();

    do_cleanups (old_chain);

    return rtnval;
}
Пример #4
0
static ptid_t
nbsd_thread_wait (struct target_ops *ops, ptid_t ptid,
  struct target_waitstatus *ourstatus, int options)
{
  ptid_t rtnval;
  struct target_ops *beneath = find_target_beneath (ops);

  rtnval = beneath->to_wait (beneath, ptid, ourstatus, options);

  nbsd_thread_unsuspend();

  if (nbsd_thread_active && (ourstatus->kind != TARGET_WAITKIND_EXITED))
    {
      rtnval = find_active_thread ();
      if (ptid_equal (rtnval, minus_one_ptid))
	error ("No active thread!\n");
      if (!in_thread_list (rtnval))
	add_thread (rtnval);
    }

  return rtnval;
}