[Pkg-mono-svn-commits] [mono] 15/23: Use InterlockedExchange64 () for Interlocked.Exchange (long&, long). (cherry picked from commit b9db6c2071f2c2cfa36cc32a0150eacdff586376)

Jo Shields directhex at alioth.debian.org
Wed Oct 23 22:14:31 UTC 2013


This is an automated email from the git hooks/post-receive script.

directhex pushed a commit to branch master-experimental-patches/atomics_support_on_fringe_32bit_platforms
in repository mono.

commit deeb1c8907406eab4381cbe27687857267711765
Author: Alex Rønne Petersen <alexrp at xamarin.com>
Date:   Wed Sep 25 20:22:36 2013 +0200

    Use InterlockedExchange64 () for Interlocked.Exchange (long&, long).
    (cherry picked from commit b9db6c2071f2c2cfa36cc32a0150eacdff586376)
---
 mono/metadata/threads.c |   17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)

diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c
index 66e7f8c..c69e65d 100755
--- a/mono/metadata/threads.c
+++ b/mono/metadata/threads.c
@@ -1833,22 +1833,7 @@ gfloat ves_icall_System_Threading_Interlocked_Exchange_Single (gfloat *location,
 gint64 
 ves_icall_System_Threading_Interlocked_Exchange_Long (gint64 *location, gint64 value)
 {
-#if SIZEOF_VOID_P == 8
-	return (gint64) InterlockedExchangePointer((gpointer *) location, (gpointer)value);
-#else
-	gint64 res;
-
-	/* 
-	 * According to MSDN, this function is only atomic with regards to the 
-	 * other Interlocked functions on 32 bit platforms.
-	 */
-	mono_interlocked_lock ();
-	res = *location;
-	*location = value;
-	mono_interlocked_unlock ();
-
-	return res;
-#endif
+	return InterlockedExchange64 (location, value);
 }
 
 gdouble 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mono/packages/mono.git



More information about the Pkg-mono-svn-commits mailing list