arch_test_and_set_bit_lock(9)
okay bestie, this is arch_test_and_set_bit_lock(9) from the Kernel API Manual, and itβs giving βset a bit, return the old value, lock editionβ energy π
β¨
πΈ NAME πΈ
arch_test_and_set_bit_lock β set a bit and return its old value, for lock π
β¨ SYNOPSIS β¨
int arch_test_and_set_bit_lock (unsigned int nr , volatile unsigned long *addr );
π ARGUMENTS π
nrβ the bit to set, periodt πaddrβ the address to count from π«Ά
π₯ DESCRIPTION π₯
okay so hereβs the tea: this operation is atomic π₯ and provides acquire barrier semantics if the returned value is 0. It can be used to implement bit locks π.
π¦ SEE ALSO π¦
- Kernel file:
./include/asm-generic/bitops/lock.h arch_clear_bit_unlock(9)arch___clear_bit_unlock(9)
source/version: ./include/asm-generic/bitops Β· date: October 2026 Β· page: arch_test_and_set_bit_lock(9) β slay and goodnight, bestie πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms