summaryrefslogtreecommitdiff
path: root/ACE/ace/Monitor_Control/Auto_Update_Starter.cpp
blob: 98bbd87374c9dd9d2aae55310c1dc9953def6308 (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
30
31
32
33
34
35
// $Id$

#include "ace/Monitor_Control/Auto_Update_Starter.h"

#if defined (ACE_HAS_MONITOR_FRAMEWORK) && (ACE_HAS_MONITOR_FRAMEWORK == 1)

#include "ace/Reactor.h"
#include "ace/Dynamic_Service.h"
#include "ace/Monitor_Admin_Manager.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

namespace ACE
{
  namespace Monitor_Control
  {
    int
    Auto_Update_Starter::svc (void)
    {
      MC_ADMINMANAGER* mgr =
        ACE_Dynamic_Service<MC_ADMINMANAGER>::instance ("MC_ADMINMANAGER");

      /// We want the thread in which the event loop is started to
      /// own the reactor, otherwise the handle_timeout() calls
      /// aren't triggerd.
      mgr->admin ().reactor ()->owner (ACE_Thread::self ());

      return mgr->admin ().reactor ()->run_reactor_event_loop ();
    }
  }
}

ACE_END_VERSIONED_NAMESPACE_DECL

#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */