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

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 413523f8392604551b2ffb29528e2ae3b26bfb77
Author: Alex Rønne Petersen <alexrp at xamarin.com>
Date:   Wed Sep 25 20:23:36 2013 +0200

    Use InterlockedExchange64 () for Interlocked.Exchange (double&, double).
    (cherry picked from commit d785b33891091153ced9e632129badc7262efca9)
---
 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 c69e65d..4f710ce 100755
--- a/mono/metadata/threads.c
+++ b/mono/metadata/threads.c
@@ -1839,27 +1839,12 @@ ves_icall_System_Threading_Interlocked_Exchange_Long (gint64 *location, gint64 v
 gdouble 
 ves_icall_System_Threading_Interlocked_Exchange_Double (gdouble *location, gdouble value)
 {
-#if SIZEOF_VOID_P == 8
 	LongDoubleUnion val, ret;
 
 	val.fval = value;
-	ret.ival = (gint64)InterlockedExchangePointer((gpointer *) location, (gpointer)val.ival);
+	ret.ival = (gint64)InterlockedExchange64((gint64 *) location, val.ival);
 
 	return ret.fval;
-#else
-	gdouble 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
 }
 
 gint32 ves_icall_System_Threading_Interlocked_CompareExchange_Int(gint32 *location, gint32 value, gint32 comparand)

-- 
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