'\" t .\" Title: list_empty_careful .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: January 2017 .\" Manual: Data Types .\" Source: Kernel Hackers Manual 4.8.15 .\" Language: English .\" .TH "LIST_EMPTY_CAREFUL" "9" "January 2017" "Kernel Hackers Manual 4\&.8\&." "Data Types" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" list_empty_careful \- tests whether a list is empty and not being modified .SH "SYNOPSIS" .HP \w'int\ list_empty_careful('u .BI "int list_empty_careful(const\ struct\ list_head\ *\ " "head" ");" .SH "ARGUMENTS" .PP \fIhead\fR .RS 4 the list to test .RE .SH "DESCRIPTION" .PP tests whether a list is empty _and_ checks that no other CPU might be in the process of modifying either member (next or prev) .SH "NOTE" .PP using \fBlist_empty_careful\fR without synchronization can only be safe if the only activity that can happen to the list entry is \fBlist_del_init\fR\&. Eg\&. it cannot be used if another CPU could re\-\fBlist_add\fR it\&. .SH "COPYRIGHT" .br