diff options
author | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-07-21 19:21:31 +0000 |
---|---|---|
committer | coryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-07-21 19:21:31 +0000 |
commit | ce80aa3a26fcaf645d835993a1e8f24e45d6ad9f (patch) | |
tree | 0e1cc2bb3316f4bedfc377ed68c89dc8f3d9afec /TAO/tao/ORB.i | |
parent | 11235e05441c26ca63c7784131d3b57d723adb8c (diff) | |
download | ATCD-ce80aa3a26fcaf645d835993a1e8f24e45d6ad9f.tar.gz |
ChangeLogTag:Tue Jul 21 14:19:28 1998 Carlos O'Ryan <coryan@cs.wustl.edu>
Diffstat (limited to 'TAO/tao/ORB.i')
-rw-r--r-- | TAO/tao/ORB.i | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/TAO/tao/ORB.i b/TAO/tao/ORB.i index 68391fe1b39..c429e0881e4 100644 --- a/TAO/tao/ORB.i +++ b/TAO/tao/ORB.i @@ -155,13 +155,6 @@ CORBA::wstring_dup (const WChar *const str) // CORBA dup/release build on top of COM's (why not). -ACE_INLINE void -CORBA::release (CORBA::ORB_ptr obj) -{ - if (obj) - obj->_decr_refcnt (); -} - // --------------------------------------------------------------------------- // ORB specific // --------------------------------------------------------------------------- @@ -169,9 +162,22 @@ CORBA::release (CORBA::ORB_ptr obj) ACE_INLINE CORBA::ULong CORBA_ORB::_incr_refcnt (void) { - ACE_MT (ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, lock_, 0)); + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, guard, lock_, 0); + return ++this->refcount_; +} - return refcount_++; +ACE_INLINE CORBA::ULong +CORBA_ORB::_decr_refcnt (void) +{ + { + ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->lock_, 0); + this->refcount_--; + if (this->refcount_ != 0) + return this->refcount_; + } + + delete this; + return 0; } ACE_INLINE CORBA::ORB_ptr @@ -182,6 +188,13 @@ CORBA_ORB::_duplicate (CORBA::ORB_ptr obj) return obj; } +ACE_INLINE void +CORBA::release (CORBA::ORB_ptr obj) +{ + if (obj) + obj->_decr_refcnt (); +} + // Null pointers represent nil objects. ACE_INLINE CORBA::ORB_ptr @@ -193,7 +206,7 @@ CORBA_ORB::_nil (void) ACE_INLINE CORBA::Boolean CORBA::is_nil (CORBA::ORB_ptr obj) { - return (CORBA::Boolean) (obj == 0); + return obj == 0; } ACE_INLINE CORBA::Boolean |