'\" t .\" Title: __test_and_set_bit .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: July 2017 .\" Manual: Basic C Library Functions .\" Source: Kernel Hackers Manual 4.11.6 .\" Language: English .\" .TH "__TEST_AND_SET_BIT" "9" "July 2017" "Kernel Hackers Manual 4\&.11\&" "Basic C Library Functions" .\" ----------------------------------------------------------------- .\" * 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" __test_and_set_bit \- Set a bit and return its old value .SH "SYNOPSIS" .HP \w'bool\ __test_and_set_bit('u .BI "bool __test_and_set_bit(long\ " "nr" ", volatile\ unsigned\ long\ *\ " "addr" ");" .SH "ARGUMENTS" .PP \fIlong nr\fR .RS 4 Bit to set .RE .PP \fIvolatile unsigned long * addr\fR .RS 4 Address to count from .RE .SH "DESCRIPTION" .PP This operation is non\-atomic and can be reordered\&. If two examples of this operation race, one can appear to succeed but actually fail\&. You must protect multiple accesses with a lock\&. .SH "COPYRIGHT" .br