Beispiel #1
0
int
TAO_Naming_Service::run (void)
{
  ORB_Runner runner (this->orb_.in(), time_);
  if (this->num_threads_ == 1)
    return runner.svc();
  else
    {
      runner.activate ( THR_NEW_LWP | THR_JOINABLE | THR_INHERIT_SCHED,
                        this->num_threads_);
      runner.wait();
    }
  return 0;
}
int
ImR_Locator_i::run (void)
{
  if (debug_ > 0)
    {
      // This debug message was split into two calls to
      // work around yet another bug in Visual Studio 2005.
      // When this was a single debug message, the value for
      // debug () came out garbled and the read-only string
      // caused an ACCESS VIOLATION -- Chad Elliott 10/4/2006
      ORBSVCS_DEBUG ((LM_DEBUG,
                      ACE_TEXT ("Implementation Repository: Running\n")
                      ACE_TEXT ("\tPing Interval : %dms\n")
                      ACE_TEXT ("\tStartup Timeout : %ds\n")
                      ACE_TEXT ("\tPersistence : %s\n")
                      ACE_TEXT ("\tMulticast : %C\n")
                      ACE_TEXT ("\tThreads : %d\n"),
                      this->opts_->ping_interval ().msec (),
                      this->opts_->startup_timeout ().sec (),
                      this->repository_->repo_mode (),
                      (this->repository_->multicast () != 0 ?
                       "Enabled" : "Disabled"),
                      this->opts_->threads () ));
      ORBSVCS_DEBUG ((LM_DEBUG,
                      ACE_TEXT ("\tDebug : %d\n")
                      ACE_TEXT ("\tReadOnly : %C\n\n"),
                      debug (),
                      (this->opts_->readonly () ? "True" : "False")));
    }
  this->auto_start_servers ();

  if (true /* this->opts_->threads () == 1 */)
    {
      this->orb_->run ();
    }
  else
    {
      ORB_Runner runner (this->orb_);
      runner.activate (THR_NEW_LWP | THR_JOINABLE, this->opts_->threads ());
      runner.wait ();
    }
  return 0;
}