.TH "__test_and_set_bit" 9 "__test_and_set_bit" "25 May 1998" "Kernel Hacker's Manual" LINUX .SH NAME __test_and_set_bit \- Set a bit and return its old value .SH SYNOPSIS .B "int" __test_and_set_bit .BI "(int " nr "," .BI "volatile void *" addr ");" .SH ARGUMENTS .IP "nr" 12 Bit to set .IP "addr" 12 Address to count from .SH "DESCRIPTION" 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.