---
name: "atomic_dec_and_mutex_lock"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/atomic_dec_and_mutex_lock"
---

# atomic\_dec\_and\_mutex\_lock(9)

return holding mutex if we dec to 0

## NAME

atomic\_dec\_and\_mutex\_lock - return holding mutex if we dec to 0

## SYNOPSIS

**int atomic\_dec\_and\_mutex\_lock(atomic\_t \*** *cnt***, struct mutex \*** *lock***);**

## ARGUMENTS

*cnt*

the atomic which we are to dec

*lock*

the mutex to return holding if we dec to 0

## DESCRIPTION

return true and hold lock if we dec to 0, return false otherwise

## AUTHOR

**Rusty Russell** \<rusty@rustcorp.com.au\>

Author.

## COPYRIGHT
