зеркало из https://github.com/mozilla/pjs.git
bug 330765 - patch from romaxa to fix NativeCompareAndSwap implementation on ARM. r=myself
This commit is contained in:
Родитель
aab1d42301
Коммит
5205223f92
|
@ -187,8 +187,14 @@ JS_STATIC_ASSERT(sizeof(jsword) == sizeof(int));
|
|||
static JS_INLINE int
|
||||
NativeCompareAndSwap(jsword *w, jsword ov, jsword nv)
|
||||
{
|
||||
volatile int *vp = (volatile int*)w;
|
||||
return !__kernel_cmpxchg(ov, nv, vp);
|
||||
volatile int *vp = (volatile int *) w;
|
||||
PRInt32 failed = 1;
|
||||
|
||||
/* Loop until a __kernel_cmpxchg succeeds. See bug 446169 */
|
||||
do {
|
||||
failed = __kernel_cmpxchg(ov, nv, vp);
|
||||
} while (failed && *vp == ov);
|
||||
return !failed;
|
||||
}
|
||||
|
||||
#else
|
||||
|
|
Загрузка…
Ссылка в новой задаче