add_unless 486 B

12345678910111213141516171819
  1. if [ -z "${pfx}" ]; then
  2. desc_return="Return: @true if @v was updated, @false otherwise."
  3. fi
  4. cat <<EOF
  5. /**
  6. * ${class}${atomicname}() - atomic add unless value with ${desc_order} ordering
  7. * @v: pointer to ${atomic}_t
  8. * @a: ${int} value to add
  9. * @u: ${int} value to compare with
  10. *
  11. * If (@v != @u), atomically updates @v to (@v + @a) with ${desc_order} ordering.
  12. * Otherwise, @v is not modified and relaxed ordering is provided.
  13. *
  14. * ${desc_noinstr}
  15. *
  16. * ${desc_return}
  17. */
  18. EOF