arch_test_and_set_bit_lock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

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 πŸ¦‹


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