list_empty_careful(9)

list_empty_careful9

Tests whether a list is empty and not being modified

Usage

int list_empty_careful(const struct list_head * head);

Arguments

head

the list to test

Overview

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.

Releases

6 releases since Debian 4.0 (Etch); the text changed 5 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9

From linux-manual-4.9 4.9.228-1 in Debian 9 (Stretch). Parsed by carta from the page's man source.