stdcxx-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From far...@apache.org
Subject svn commit: r570431 - /incubator/stdcxx/trunk/include/rw/_mutex.h
Date Tue, 28 Aug 2007 14:00:11 GMT
Author: faridz
Date: Tue Aug 28 07:00:10 2007
New Revision: 570431

URL: http://svn.apache.org/viewvc?rev=570431&view=rev
Log:
2007-08-28 Farid Zaripov <Farid_Zaripov@epam.com>

	* _mutex.h [__ia64 || __x86_64]: Define set of __rw_atomic_xxx()
	functions for types _RWSTD_LONG_LONG and unsigned _RWSTD_LONG_LONG.

Modified:
    incubator/stdcxx/trunk/include/rw/_mutex.h

Modified: incubator/stdcxx/trunk/include/rw/_mutex.h
URL: http://svn.apache.org/viewvc/incubator/stdcxx/trunk/include/rw/_mutex.h?rev=570431&r1=570430&r2=570431&view=diff
==============================================================================
--- incubator/stdcxx/trunk/include/rw/_mutex.h (original)
+++ incubator/stdcxx/trunk/include/rw/_mutex.h Tue Aug 28 07:00:10 2007
@@ -1527,6 +1527,32 @@
 #endif   // _RWSTD_LONG_SIZE
 
 
+#ifdef _RWSTD_LONG_LONG
+#  if _RWSTD_LLONG_SIZE > _RWSTD_LONG_SIZE
+
+inline _RWSTD_LONG_LONG
+__rw_atomic_preincrement (_RWSTD_LONG_LONG &__x, bool)
+{
+    _RWSTD_COMPILE_ASSERT (8 == sizeof (_RWSTD_LONG_LONG));
+
+    return __rw_atomic_add64 (_RWSTD_REINTERPRET_CAST (_RWSTD_INT64_T*, &__x),
+                              +1);
+}
+
+
+inline unsigned _RWSTD_LONG_LONG
+__rw_atomic_preincrement (unsigned _RWSTD_LONG_LONG &__x, bool)
+{
+    _RWSTD_COMPILE_ASSERT (8 == sizeof (unsigned _RWSTD_LONG_LONG));
+
+    return __rw_atomic_add64 (_RWSTD_REINTERPRET_CAST (_RWSTD_INT64_T*, &__x),
+                              +1);
+}
+
+#  endif   // _RWSTD_LLONG_SIZE > _RWSTD_LONG_SIZE
+#endif   // _RWSTD_LONG_LONG
+
+
 inline char
 __rw_atomic_predecrement (char &__x, bool)
 {
@@ -1612,7 +1638,7 @@
 inline unsigned long
 __rw_atomic_predecrement (unsigned long &__x, bool)
 {
-    _RWSTD_COMPILE_ASSERT (8 == sizeof (long));
+    _RWSTD_COMPILE_ASSERT (8 == sizeof (unsigned long));
 
     return __rw_atomic_add64 (_RWSTD_REINTERPRET_CAST (_RWSTD_INT64_T*, &__x),
                               -1);
@@ -1621,6 +1647,32 @@
 #endif   // _RWSTD_LONG_SIZE
 
 
+#ifdef _RWSTD_LONG_LONG
+#  if _RWSTD_LLONG_SIZE > _RWSTD_LONG_SIZE
+
+inline _RWSTD_LONG_LONG
+__rw_atomic_predecrement (_RWSTD_LONG_LONG &__x, bool)
+{
+    _RWSTD_COMPILE_ASSERT (8 == sizeof (_RWSTD_LONG_LONG));
+
+    return __rw_atomic_add64 (_RWSTD_REINTERPRET_CAST (_RWSTD_INT64_T*, &__x),
+                              -1);
+}
+
+
+inline unsigned _RWSTD_LONG_LONG
+__rw_atomic_predecrement (unsigned _RWSTD_LONG_LONG &__x, bool)
+{
+    _RWSTD_COMPILE_ASSERT (8 == sizeof (unsigned _RWSTD_LONG_LONG));
+
+    return __rw_atomic_add64 (_RWSTD_REINTERPRET_CAST (_RWSTD_INT64_T*, &__x),
+                              -1);
+}
+
+#  endif   // _RWSTD_LLONG_SIZE > _RWSTD_LONG_SIZE
+#endif   // _RWSTD_LONG_LONG
+
+
 inline char
 __rw_atomic_exchange (char &__x, char __y, bool)
 {
@@ -1713,6 +1765,34 @@
 }
 
 #  endif   // _RWSTD_LONG_SIZE == _RWSTD_INT_SIZE
+
+
+#ifdef _RWSTD_LONG_LONG
+#  if _RWSTD_LLONG_SIZE > _RWSTD_LONG_SIZE
+
+inline _RWSTD_LONG_LONG
+__rw_atomic_exchange (_RWSTD_LONG_LONG &__x, _RWSTD_LONG_LONG __y, bool)
+{
+    _RWSTD_COMPILE_ASSERT (8 == sizeof (_RWSTD_LONG_LONG));
+
+    return __rw_atomic_xchg64 (_RWSTD_REINTERPRET_CAST (_RWSTD_INT64_T*, &__x),
+                               _RWSTD_STATIC_CAST (_RWSTD_INT64_T, __y));
+}
+
+
+inline unsigned _RWSTD_LONG_LONG
+__rw_atomic_exchange (unsigned _RWSTD_LONG_LONG &__x,
+                      unsigned _RWSTD_LONG_LONG __y, bool)
+{
+    _RWSTD_COMPILE_ASSERT (8 == sizeof (unsigned _RWSTD_LONG_LONG));
+
+    return __rw_atomic_xchg64 (_RWSTD_REINTERPRET_CAST (_RWSTD_INT64_T*, &__x),
+                               _RWSTD_STATIC_CAST (_RWSTD_INT64_T, __y));
+}
+
+#  endif   // _RWSTD_LLONG_SIZE > _RWSTD_LONG_SIZE
+#endif   // _RWSTD_LONG_LONG
+
 
 #elif !defined (_RWSTD_NO_ATOMIC_OPS)
 #  define _RWSTD_NO_ATOMIC_OPS



Mime
View raw message