예제 #1
0
void Client::send_request(const Request& req) {
   ClientQuery query(*this, req);

   prune_threads();

   threads_.push_back(ThreadPtr(new boost::thread(query)));
}
예제 #2
0
static void
obsd_update_thread_list (struct target_ops *ops)
{
  pid_t pid = ptid_get_pid (inferior_ptid);
  struct ptrace_thread_state pts;

  prune_threads ();

  if (ptrace (PT_GET_THREAD_FIRST, pid, (caddr_t)&pts, sizeof pts) == -1)
    perror_with_name (("ptrace"));

  while (pts.pts_tid != -1)
    {
      ptid_t ptid = ptid_build (pid, pts.pts_tid, 0);

      if (!in_thread_list (ptid))
	{
	  if (ptid_get_lwp (inferior_ptid) == 0)
	    thread_change_ptid (inferior_ptid, ptid);
	  else
	    add_thread (ptid);
	}

      if (ptrace (PT_GET_THREAD_NEXT, pid, (caddr_t)&pts, sizeof pts) == -1)
	perror_with_name (("ptrace"));
    }
}
예제 #3
0
void GraphOracle::query_best_connection(std::shared_ptr<std::vector<SongId> > ids) {
    MultipleGraphOracleQuery query(ids);

    prune_threads();

    threads_.push_back(ThreadPtr(new boost::thread(query)));
}
예제 #4
0
void GraphOracle::query_best_connection(SongId id) {

    // THIS IS CROWDTAP SPECIFIC CODE TO BE REPLACED

    SongId other_id = PlayManager::instance().now_playing()->song().id();

    GraphNodeFactory::instance().add_pair_request(PairRequest(id, other_id));

    return;


    // THIS IS DUMMY CODE TO BE REPLACED

    other_id = SongFactory::instance().get_random_song_id();

    while (other_id == id || (GraphNodeFactory::instance().song_map().find(
        other_id) == GraphNodeFactory::instance().song_map().end())) {
        other_id = SongFactory::instance().get_random_song_id();
    }

    GraphNodeFactory::instance().add_pair_request(PairRequest(id, other_id));

    return;
    
    // BEGIN ACTUAL CODE!!!

   SingleGraphOracleQuery query(id);

   prune_threads();

   threads_.push_back(ThreadPtr(new boost::thread(query)));
}
예제 #5
0
static void
fbsd_update_thread_list (struct target_ops *ops)
{
#ifdef PT_LWP_EVENTS
  /* With support for thread events, threads are added/deleted from the
     list as events are reported, so just try deleting exited threads.  */
  delete_exited_threads ();
#else
  prune_threads ();

  fbsd_add_threads (ptid_get_pid (inferior_ptid));
#endif
}
예제 #6
0
void
fbsd_nat_target::update_thread_list ()
{
#ifdef PT_LWP_EVENTS
  /* With support for thread events, threads are added/deleted from the
     list as events are reported, so just try deleting exited threads.  */
  delete_exited_threads ();
#else
  prune_threads ();

  fbsd_add_threads (inferior_ptid.pid ());
#endif
}