mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-26 11:35:33 +00:00
loongarch64: implement atomic_dec_and_test
It is used in criu/pie/restorer.c. Signed-off-by: Andrei Vagin <avagin@google.com>
This commit is contained in:
parent
33639b5458
commit
bbf3c691fd
1 changed files with 2 additions and 0 deletions
|
|
@ -41,6 +41,8 @@ static inline int atomic_add_return(int i, atomic_t *v)
|
|||
#define atomic_inc_return(v) atomic_add_return(1, v)
|
||||
#define atomic_dec(v) atomic_sub(1, v)
|
||||
#define atomic_dec_return(v) atomic_sub_return(1, v)
|
||||
/* true if the result is 0, or false for all other cases. */
|
||||
#define atomic_dec_and_test(v) (atomic_sub_return(1, v) == 0)
|
||||
|
||||
static inline int atomic_cmpxchg(atomic_t *ptr, int old, int new)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue