mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fixes by w3seek regarding interlocked functions. These were due to my
missing a mismatch between the glib functions and windows variants. svn path=/trunk/; revision=13892
This commit is contained in:
parent
34d49aaa33
commit
53af8e03f3
1 changed files with 7 additions and 5 deletions
|
@ -136,8 +136,8 @@ InterlockedExchange(LPLONG target, LONG value )
|
||||||
"lock\n\txchgl %0,(%1)"
|
"lock\n\txchgl %0,(%1)"
|
||||||
:"=r" (ret):"r" (target), "0" (value):"memory" );
|
:"=r" (ret):"r" (target), "0" (value):"memory" );
|
||||||
#elif defined(_M_PPC)
|
#elif defined(_M_PPC)
|
||||||
ret = *target;
|
ret = *(volatile LONG *)target;
|
||||||
while( InterlockedCompareExchange( target, value, ret ) != value );
|
while( InterlockedCompareExchange( target, value, ret ) != ret );
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -202,9 +202,11 @@ InterlockedExchangeAdd(
|
||||||
:"r" (Addend), "0" (Increment)
|
:"r" (Addend), "0" (Increment)
|
||||||
:"memory" );
|
:"memory" );
|
||||||
#elif defined(_M_PPC)
|
#elif defined(_M_PPC)
|
||||||
do
|
LONG newval;
|
||||||
ret = *Addend;
|
do {
|
||||||
while (!InterlockedCompareExchange(Addend, ret, ret + Increment));
|
ret = *(volatile LONG *)Addend;
|
||||||
|
newval = ret + Increment;
|
||||||
|
} while (InterlockedCompareExchange(Addend, ret, newval) != ret);
|
||||||
#endif
|
#endif
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue