summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>2004-12-11 16:43:54 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>2004-12-11 16:43:54 +0000
commit9b4e1077fc55203bed7fa4dc6fa93464177b429e (patch)
tree98e0aae2a8650bc4ec6cd631eb3268d78b454aec /ace
parentffdc350ae1e46eb2e7336f9f13abfda80e21fd2a (diff)
downloadATCD-9b4e1077fc55203bed7fa4dc6fa93464177b429e.tar.gz
ChangeLogTag:Sat Dec 11 10:39:38 2004 Douglas C. Schmidt <schmidt@cs.wustl.edu>
Diffstat (limited to 'ace')
-rw-r--r--ace/Atomic_Op.h4
-rw-r--r--ace/Atomic_Op.inl6
-rw-r--r--ace/Atomic_Op_T.h4
-rw-r--r--ace/Atomic_Op_T.inl22
4 files changed, 21 insertions, 15 deletions
diff --git a/ace/Atomic_Op.h b/ace/Atomic_Op.h
index ee0c330bf4a..3522234287e 100644
--- a/ace/Atomic_Op.h
+++ b/ace/Atomic_Op.h
@@ -103,10 +103,10 @@ public:
bool operator< (long rhs) const;
/// Atomically assign rhs to <value_>.
- void operator= (long rhs);
+ ACE_Atomic_Op<ACE_Thread_Mutex, long> &operator= (long rhs);
/// Atomically assign <rhs> to <value_>.
- void operator= (const ACE_Atomic_Op<ACE_Thread_Mutex, long> &rhs);
+ ACE_Atomic_Op<ACE_Thread_Mutex, long> &operator= (const ACE_Atomic_Op<ACE_Thread_Mutex, long> &rhs);
/// Explicitly return <value_>.
long value (void) const;
diff --git a/ace/Atomic_Op.inl b/ace/Atomic_Op.inl
index 6194d8a7318..352c2afef4e 100644
--- a/ace/Atomic_Op.inl
+++ b/ace/Atomic_Op.inl
@@ -114,7 +114,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator< (long rhs) const
return (this->value_ < rhs);
}
-ACE_INLINE void
+ACE_INLINE ACE_Atomic_Op<ACE_Thread_Mutex, long> &
ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator= (long rhs)
{
#if defined (WIN32)
@@ -122,9 +122,10 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator= (long rhs)
#else /* WIN32 */
(*exchange_fn_) (&this->value_, rhs);
#endif /* WIN32 */
+ return *this;
}
-ACE_INLINE void
+ACE_INLINE ACE_Atomic_Op<ACE_Thread_Mutex, long> &
ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator= (
const ACE_Atomic_Op<ACE_Thread_Mutex, long> &rhs)
{
@@ -133,6 +134,7 @@ ACE_Atomic_Op<ACE_Thread_Mutex, long>::operator= (
#else /* WIN32 */
(*exchange_fn_) (&this->value_, rhs.value_);
#endif /* WIN32 */
+ return *this;
}
ACE_INLINE long
diff --git a/ace/Atomic_Op_T.h b/ace/Atomic_Op_T.h
index f536a349662..2d3da0efee5 100644
--- a/ace/Atomic_Op_T.h
+++ b/ace/Atomic_Op_T.h
@@ -89,10 +89,10 @@ public:
bool operator< (const TYPE &rhs) const;
/// Atomically assign rhs to <value_>.
- void operator= (const TYPE &rhs);
+ ACE_INLINE ACE_Atomic_Op_Ex<ACE_LOCK, TYPE> &operator= (const TYPE &rhs);
/// Atomically assign <rhs> to <value_>.
- void operator= (const ACE_Atomic_Op_Ex<ACE_LOCK, TYPE> &rhs);
+ ACE_INLINE ACE_Atomic_Op_Ex<ACE_LOCK, TYPE> &operator= (const ACE_Atomic_Op_Ex<ACE_LOCK, TYPE> &rhs);
/// Explicitly return <value_>.
TYPE value (void) const;
diff --git a/ace/Atomic_Op_T.inl b/ace/Atomic_Op_T.inl
index ccdfee63905..6077ca4055f 100644
--- a/ace/Atomic_Op_T.inl
+++ b/ace/Atomic_Op_T.inl
@@ -111,17 +111,18 @@ ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator< (const TYPE &rhs) const
return this->value_ < rhs;
}
-template <class ACE_LOCK, class TYPE> ACE_INLINE void
+template <class ACE_LOCK, class TYPE> ACE_INLINE ACE_Atomic_Op_Ex<ACE_LOCK, TYPE> &
ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator= (const ACE_Atomic_Op_Ex<ACE_LOCK, TYPE> &rhs)
{
// ACE_TRACE ("ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator=");
if (&rhs == this)
- return; // Avoid deadlock...
- ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_);
- // This will call ACE_Atomic_Op_Ex::TYPE(), which will ensure the value
- // of <rhs> is acquired atomically.
+ return *this; // Avoid deadlock...
+ ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, *this);
+ // This will call ACE_Atomic_Op_Ex::TYPE(), which will ensure the
+ // value of <rhs> is acquired atomically.
this->value_ = rhs.value ();
+ return *this;
}
template <class ACE_LOCK, class TYPE> ACE_INLINE TYPE
@@ -142,28 +143,31 @@ ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::value_i (void)
return this->value_;
}
-template <class ACE_LOCK, class TYPE> ACE_INLINE void
+template <class ACE_LOCK, class TYPE> ACE_INLINE ACE_Atomic_Op_Ex<ACE_LOCK, TYPE> &
ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator= (const TYPE &rhs)
{
// ACE_TRACE ("ACE_Atomic_Op_Ex<ACE_LOCK, TYPE>::operator=");
- ACE_GUARD (ACE_LOCK, ace_mon, this->mutex_);
+ ACE_GUARD_RETURN (ACE_LOCK, ace_mon, this->mutex_, *this);
this->value_ = rhs;
+ return *this;
}
//
// ACE_Atomic_Op inline functions
//
-template <class ACE_LOCK, class TYPE> ACE_INLINE void
+template <class ACE_LOCK, class TYPE> ACE_INLINE ACE_Atomic_Op<ACE_LOCK, TYPE> &
ACE_Atomic_Op<ACE_LOCK, TYPE>::operator= (const TYPE &i)
{
this->impl_ = i;
+ return *this;
}
-template <class ACE_LOCK, class TYPE> ACE_INLINE void
+template <class ACE_LOCK, class TYPE> ACE_INLINE ACE_Atomic_Op<ACE_LOCK, TYPE> &
ACE_Atomic_Op<ACE_LOCK, TYPE>::operator= (const ACE_Atomic_Op<ACE_LOCK, TYPE> &rhs)
{
this->impl_ = rhs.impl_;
+ return *this;
}
template <class ACE_LOCK, class TYPE> ACE_INLINE TYPE