---
name: "__atomic_add_unless"
section: "9"
platform: "linux"
package: "linux-manual-3.16"
version: "3.16.56-1+deb8u1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/__atomic_add_unless"
---

# \_\_atomic\_add\_unless(9)

add unless the number is already a given value

## NAME

\_\_atomic\_add\_unless - add unless the number is already a given value

## SYNOPSIS

**int \_\_atomic\_add\_unless(atomic\_t \*** *v***, int** *a***, int** *u***);**

## ARGUMENTS

*v*

pointer of type atomic\_t

*a*

the amount to add to v...

*u*

...unless v is equal to u.

## DESCRIPTION

Atomically adds *a* to *v*, so long as *v* was not already *u*. Returns the old value of *v*.

## COPYRIGHT
