summaryrefslogtreecommitdiff
path: root/ACE/ace/Monitor_Control_Action.cpp
blob: 995c365dbf221beb2f30868584d8fb2d11133774 (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
36
37
38
39
40
#include "ace/Monitor_Control_Action.h"

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

#include "ace/Guard_T.h"

ACE_BEGIN_VERSIONED_NAMESPACE_DECL

namespace ACE
{
  namespace Monitor_Control
  {
    Control_Action::Control_Action ()
      : ACE_Refcountable_T<ACE_SYNCH_MUTEX> (1)
    {}

    void
    Control_Action::add_ref ()
    {
      (void) this->increment ();
    }

    void
    Control_Action::remove_ref ()
    {
      const long new_count = this->decrement ();

      if (new_count == 0)
        {
          delete this;
        }
    }
  }
}

ACE_END_VERSIONED_NAMESPACE_DECL

#endif /* ACE_HAS_MONITOR_FRAMEWORK==1 */