summaryrefslogtreecommitdiff
path: root/TAO/tao/Context.cpp
blob: 6bbe2795d24440f7e4c28078d45bc115b9c56537 (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
// $Id$

#include "tao/Context.h"

#if !defined (__ACE_INLINE__)
# include "tao/Context.i"
#endif /* ! __ACE_INLINE__ */

CORBA_Context::CORBA_Context (void)
{
}

CORBA_Context::~CORBA_Context (void)
{
}

CORBA::ULong
CORBA_Context::_incr_refcnt (void)
{
  ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->refcount_lock_, 0);
  return refcount_++;
}

CORBA::ULong
CORBA_Context::_decr_refcnt (void)
{
  {
    ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, ace_mon, this->refcount_lock_, 0);
    this->refcount_--;
    if (this->refcount_ != 0)
      return this->refcount_;
  }

  delete this;
  return 0;
}