(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 and 1.12.18.2

version 1.12, 2007/01/11 16:21:54 version 1.12.18.2, 2008/06/10 15:33:33
Line 842 
Line 842 
  
 //============================================================================== //==============================================================================
 // //
   // PEGASUS_PLATFORM_SOLARIS_IX86_CC
   // PEGASUS_PLATFORM_SOLARIS_X86_64_CC
   //
   //==============================================================================
   
   #if defined(PEGASUS_PLATFORM_SOLARIS_IX86_CC) || \
       defined(PEGASUS_PLATFORM_SOLARIS_X86_64_CC)
   # define PEGASUS_ATOMIC_INT_DEFINED
   
   #include <atomic.h>
   
   PEGASUS_NAMESPACE_BEGIN
   
   struct AtomicType
   {
       volatile uint32_t 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()
   {
       atomic_inc_32(&_rep.n);
   }
   
   PEGASUS_TEMPLATE_SPECIALIZATION
   inline void AtomicIntTemplate<AtomicType>::dec()
   {
       atomic_dec_32(&_rep.n);
   }
   
   PEGASUS_TEMPLATE_SPECIALIZATION
   inline bool AtomicIntTemplate<AtomicType>::decAndTestIfZero()
   {
       return atomic_dec_32_nv(&_rep.n) == 0;
   }
   
   typedef AtomicIntTemplate<AtomicType> AtomicInt;
   
   PEGASUS_NAMESPACE_END
   
   #endif
   
   //==============================================================================
   //
 // Generic Implementation // Generic Implementation
 // //
 //============================================================================== //==============================================================================


Legend:
Removed from v.1.12  
changed lines
  Added in v.1.12.18.2

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2