2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

arch, ppc64: Add missing atomic_dec_and_test helper

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Cyrill Gorcunov
2018-05-10 17:57:41 +03:00
committed by Andrei Vagin
parent 73d015e8d9
commit 89c9ec7f2f

View File

@@ -125,6 +125,8 @@ static __inline__ int atomic_sub_return(int a, atomic_t *v)
return t;
}
/* true if the result is 0, or false for all other cases. */
#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
#define atomic_dec_return(v) (atomic_sub_return(1, v))
#define atomic_cmpxchg(v, o, n) (cmpxchg(&((v)->counter), (o), (n)))