[mono/mono] 6be13313: [runtime] Fix the interlocked increment/decrement/add functions.

"Zoltan Varga ([email protected])" <[email protected]>
Newsgroups gmane.comp.gnome.mono.patches
Message-ID <00000141e04c027f-80981659-d2ca-43f7-87b5-c7c754032a70-000000@email.amazonses.com>
   Branch: refs/heads/master
     Home: https://github.com/mono/mono
  Compare: https://github.com/mono/mono/compare/0d40321933ac...6be13313df2f

   Commit: 6be13313df2f8ed6d2b0ecbab78df4b026bfb665
   Author: Zoltan Varga <[email protected]> (vargaz)
     Date: 2013-10-22 13:11:44 GMT
      URL: https://github.com/mono/mono/commit/6be13313df2f8ed6d2b0ecbab78df4b026bfb665

[runtime] Fix the interlocked increment/decrement/add functions.

Changed paths:
  M mono/utils/atomic.h

Modified: mono/utils/atomic.h
===================================================================
@@ -183,7 +183,7 @@ static inline gint64 InterlockedIncrement64(volatile gint64 *val)
 	do {
 		get = *val;
 		set = get + 1;
-	} while (InterlockedCompareExchange64 (val, set, get) != set);
+	} while (InterlockedCompareExchange64 (val, set, get) != get);
 	return set;
 }
 
@@ -193,7 +193,7 @@ static inline gint64 InterlockedDecrement64(volatile gint64 *val)
 	do {
 		get = *val;
 		set = get - 1;
-	} while (InterlockedCompareExchange64 (val, set, get) != set);
+	} while (InterlockedCompareExchange64 (val, set, get) != get);
 	return set;
 }
 
@@ -203,7 +203,7 @@ static inline gint64 InterlockedAdd64(volatile gint64 *dest, gint64 add)
 	do {
 		get = *dest;
 		set = get + add;
-	} while (InterlockedCompareExchange64 (dest, set, get) != set);
+	} while (InterlockedCompareExchange64 (dest, set, get) != get);
 	return set;
 }
 


_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.