summaryrefslogtreecommitdiff
path: root/TAO/tests/MT_Timeout/Sleep_Service.cpp
blob: 4af378547bc6a94017cdc4afdf04c15dee814641 (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
//
// $Id$
//
#include "Sleep_Service.h"
#include "ace/OS_NS_unistd.h"

ACE_RCSID(MT_Timeout, Sleep_Service, "$Id$")

Sleep_Service::Sleep_Service (CORBA::ORB_ptr orb)
  : orb_ (CORBA::ORB::_duplicate (orb))
{
}

void
Sleep_Service::go_to_sleep (CORBA::ULong microseconds)
{
  CORBA::ULong  secs = microseconds / 1000000;
  CORBA::ULong usecs = microseconds % 1000000;
  ACE_Time_Value tv (secs, usecs);

  ACE_OS::sleep (tv);
}

void
Sleep_Service::shutdown (void)
{
  ACE_DEBUG ((LM_DEBUG, "Shutting down the ORB\n"));
  this->orb_->shutdown (0);
}