---
name: "atomic_add_unless"
section: "9"
platform: "linux"
package: "linux-manual-2.6.32"
version: "2.6.32-48squeeze6"
release: "Debian 6.0 (Squeeze)"
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 non-zero if *v* was not *u*, and zero otherwise.

## COPYRIGHT
