---
name: "list_empty_careful"
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/list_empty_careful"
---

# list\_empty\_careful(9)

tests whether a list is empty and not being modified

## NAME

list\_empty\_careful - tests whether a list is empty and not being modified

## SYNOPSIS

**int list\_empty\_careful(const struct list\_head \*** *head***);**

## ARGUMENTS

*head*

the list to test

## DESCRIPTION

tests whether a list is empty \_and\_ checks that no other CPU might be in the process of modifying either member (next or prev)

## NOTE

using **list\_empty\_careful** without synchronization can only be safe if the only activity that can happen to the list entry is **list\_del\_init**. Eg. it cannot be used if another CPU could re-**list\_add** it.

## COPYRIGHT
