[Mono-bugs] [Bug 70234][Nor] Changed - [PATCH] InterlockedIncrement on (long) 2147483647 returns wrong value

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 5 Dec 2004 17:17:35 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bmaurer@users.sf.net.

http://bugzilla.ximian.com/show_bug.cgi?id=70234

--- shadow/70234	2004-12-05 17:14:20.000000000 -0500
+++ shadow/70234.tmp.14055	2004-12-05 17:17:35.000000000 -0500
@@ -1,23 +1,23 @@
 Bug#: 70234
 Product: Mono: Runtime
 Version: 1.1
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: bmaurer@users.sf.net               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: InterlockedIncrement on (long) 2147483647 returns wrong value
+Summary: [PATCH] InterlockedIncrement on (long) 2147483647 returns wrong value
 
 [benm@omega benm]$ cat blah.cs
 using System;
 using System.Threading;
  
 class X {
@@ -37,6 +37,16 @@
 Return value   -2147483648
 
 ------- Additional Comments From bmaurer@users.sf.net  2004-12-05 17:14 -------
 Created an attachment (id=13408)
 patch
 
+
+------- Additional Comments From bmaurer@users.sf.net  2004-12-05 17:17 -------
+This fixes the bug.
+
+Note that the interlocked ops are not needed here. The implementation
+is not required to be (and is not on msft) thread safe when something
+other than Interlocked.{Increment, Decrement} is modifying the
+variable. So, the only writer to the variable inside that lock is the
+Interlocked method, which is protected by a mutex.
+