[ros-diffs] [arty] 13892: Fixes by w3seek regarding interlocked functions. These were due to my

arty at svn.reactos.com arty at svn.reactos.com
Wed Mar 9 00:01:55 CET 2005


Fixes by w3seek regarding interlocked functions.  These were due to my 
missing a mismatch between the glib functions and windows variants.
Modified: trunk/reactos/lib/rosrtl/misc/intrlck.c
  _____  

Modified: trunk/reactos/lib/rosrtl/misc/intrlck.c
--- trunk/reactos/lib/rosrtl/misc/intrlck.c	2005-03-08 22:41:27 UTC
(rev 13891)
+++ trunk/reactos/lib/rosrtl/misc/intrlck.c	2005-03-08 23:01:54 UTC
(rev 13892)
@@ -136,8 +136,8 @@

                   "lock\n\txchgl %0,(%1)"
                   :"=r" (ret):"r" (target), "0" (value):"memory" );
 #elif defined(_M_PPC)
-        ret = *target;
-        while( InterlockedCompareExchange( target, value, ret ) !=
value );
+        ret = *(volatile LONG *)target;
+        while( InterlockedCompareExchange( target, value, ret ) != ret
);
 #endif
 	return ret;
 }
@@ -202,9 +202,11 @@
                   :"r" (Addend), "0" (Increment)
                   :"memory" );
 #elif defined(_M_PPC)
-        do
-            ret = *Addend;
-        while (!InterlockedCompareExchange(Addend, ret, ret +
Increment));
+        LONG newval;
+        do {
+            ret = *(volatile LONG *)Addend;
+            newval = ret + Increment;
+        } while (InterlockedCompareExchange(Addend, ret, newval) !=
ret);
 #endif
 	return ret;
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050308/a42f6219/attachment.html


More information about the Ros-diffs mailing list