(file) Return to AtomicInt.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/AtomicInt.h between version 1.12.22.2 and 1.13

version 1.12.22.2, 2008/12/02 06:32:29 version 1.13, 2008/09/02 14:11:21
Line 907 
Line 907 
  
 //============================================================================== //==============================================================================
 // //
 // PEGASUS_PLATFORM_AIX_RS_IBMCXX  
 //  
 //==============================================================================  
   
 #if defined (PEGASUS_PLATFORM_AIX_RS_IBMCXX)  
 # define PEGASUS_ATOMIC_INT_DEFINED  
   
 # include <sys/atomic_op.h>  
   
 PEGASUS_NAMESPACE_BEGIN  
   
 struct AtomicType  
 {  
     volatile Uint32 n;  
 };  
   
 PEGASUS_TEMPLATE_SPECIALIZATION  
 inline AtomicIntTemplate<AtomicType>::AtomicIntTemplate(Uint32 n)  
 {  
     _rep.n = n;  
 }  
   
 PEGASUS_TEMPLATE_SPECIALIZATION  
 inline AtomicIntTemplate<AtomicType>::~AtomicIntTemplate()  
 {  
 }  
   
 PEGASUS_TEMPLATE_SPECIALIZATION  
 inline Uint32 AtomicIntTemplate<AtomicType>::get() const  
 {  
     return _rep.n;  
 }  
   
 PEGASUS_TEMPLATE_SPECIALIZATION  
 inline void AtomicIntTemplate<AtomicType>::set(Uint32 n)  
 {  
     _rep.n = n;  
 }  
   
 PEGASUS_TEMPLATE_SPECIALIZATION  
 inline void AtomicIntTemplate<AtomicType>::inc()  
 {  
     fetch_and_add((atomic_p)&_rep.n, 1);  
 }  
   
 PEGASUS_TEMPLATE_SPECIALIZATION  
 inline void AtomicIntTemplate<AtomicType>::dec()  
 {  
     fetch_and_add((atomic_p)&_rep.n, -1);  
 }  
   
 PEGASUS_TEMPLATE_SPECIALIZATION  
 inline bool AtomicIntTemplate<AtomicType>::decAndTestIfZero()  
 {  
     return fetch_and_add((atomic_p)&_rep.n, -1) == 1;  
 }  
   
 typedef AtomicIntTemplate<AtomicType> AtomicInt;  
   
 PEGASUS_NAMESPACE_END  
   
 #endif /* PEGASUS_PLATFORM_AIX_RS_IBMCXX */  
   
   
 //==============================================================================  
 //  
 // Generic Implementation // Generic Implementation
 // //
 //============================================================================== //==============================================================================


Legend:
Removed from v.1.12.22.2  
changed lines
  Added in v.1.13

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2