diff options
author | Alex Rønne Petersen <alexrp@xamarin.com> | 2013-09-25 20:22:36 +0200 |
---|---|---|
committer | Jo Shields <directhex@apebox.org> | 2013-10-23 15:10:45 +0100 |
commit | deeb1c8907406eab4381cbe27687857267711765 (patch) | |
tree | 588212bfe0612de54c80f7dc91829ea91b95e67f | |
parent | c1a8be1097f89b2fd75e29ca32319acc27812e95 (diff) | |
download | mono-deeb1c8907406eab4381cbe27687857267711765.tar.gz |
Use InterlockedExchange64 () for Interlocked.Exchange (long&, long).
(cherry picked from commit b9db6c2071f2c2cfa36cc32a0150eacdff586376)
-rwxr-xr-x | mono/metadata/threads.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/mono/metadata/threads.c b/mono/metadata/threads.c index 66e7f8c052..c69e65d9cf 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 |