Don't assert in Interlocked.Add () icalls on 64-bit systems.
authorAlex Rønne Petersen <alexrp@xamarin.com>
Sat, 26 Oct 2013 22:52:09 +0000 (00:52 +0200)
committerAlex Rønne Petersen <alexrp@xamarin.com>
Sat, 26 Oct 2013 22:52:09 +0000 (00:52 +0200)
The checks here were wrong in the first place; they should have
checked for MONO_ARCH_HAVE_ATOMIC_ADD rather than SIZEOF_VOID_P.
But regardless, these methods need to work when invoked via
reflection, which they wouldn't previously.

mono/metadata/threads.c

index c3548218075fe7f150d4812477d310c60e9bcb83..81f8b5c7b0f507e6c9aba705e96023a77b11fe0f 100755 (executable)
@@ -1939,25 +1939,13 @@ ves_icall_System_Threading_Interlocked_Exchange_T (MonoObject **location, MonoOb
 gint32 
 ves_icall_System_Threading_Interlocked_Add_Int (gint32 *location, gint32 value)
 {
-#if SIZEOF_VOID_P == 8
-       /* Should be implemented as a JIT intrinsic */
-       mono_raise_exception (mono_get_exception_not_implemented (NULL));
-       return 0;
-#else
        return InterlockedAdd (location, value);
-#endif
 }
 
 gint64 
 ves_icall_System_Threading_Interlocked_Add_Long (gint64 *location, gint64 value)
 {
-#if SIZEOF_VOID_P == 8
-       /* Should be implemented as a JIT intrinsic */
-       mono_raise_exception (mono_get_exception_not_implemented (NULL));
-       return 0;
-#else
        return InterlockedAdd64 (location, value);
-#endif
 }
 
 gint64