summaryrefslogtreecommitdiff
path: root/TAO/tests/Collocated_ThruP_Sp_Gd/Hello.cpp
blob: 1092b33968f911774955fb466655254fcadee55f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "Hello.h"
#include "tao/ORB_Core.h"
#include "tao/ORB_Table.h"
#include "tao/ORB_Core_Auto_Ptr.h"

  Hello::Hello (CORBA::ORB_ptr orb,
              ACE_thread_t thrid)
  : orb_ (CORBA::ORB::_duplicate (orb))
    , thr_id_ (thrid)
{
}

char *
Hello::get_string ()
{
  ACE_ERROR ((LM_DEBUG,
              "(%P|%t) ERROR: Upcall in process ..\n"));
  return CORBA::string_dup ("Hello there!");
}

void
Hello::shutdown ()
{
  // Give the client thread time to return from the collocated
  // call to this method before shutting down the ORB.  We sleep
  // to avoid BAD_INV_ORDER exceptions on fast dual processor machines.
  ACE_OS::sleep (1);
  this->orb_->shutdown (false);
}