add memory barrier
This commit is contained in:
parent
ab37b024b0
commit
dd9ddbca46
1 changed files with 1 additions and 1 deletions
|
@ -88,7 +88,7 @@ inline static int32_t atomic_int32_test_and_set(atomic_int32_t* d, int32_t ret)
|
|||
inline static int32_t atomic_int32_add(atomic_int32_t *d, int32_t i)
|
||||
{
|
||||
int32_t res = i;
|
||||
asm volatile(LOCK "xaddl %0, %1" : "=r"(i) : "m"(d->counter), "0"(i));
|
||||
asm volatile(LOCK "xaddl %0, %1" : "=r"(i) : "m"(d->counter), "0"(i) : "memory");
|
||||
return res+i;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue