Increments a single word variable atomically.
word_addr | Specifies the address of the word variable to be incremented. |
value | Specifies the value to be added to the word variable. |
The fetch_and_add kernel service atomically increments a single word. This operation is useful when a counter variable is shared between several kernel threads, since it ensures that the fetch, update, and store operations used to increment the counter occur atomically (are not interruptible).
Note: The word variable must be aligned on a full word boundary.
The fetch_and_add kernel service can be called from either the process or interrupt environment.
The fetch_and_add kernel service returns the original value of the word.
The fetch_and_add kernel service is part of the Base Operating System (BOS) Runtime.
The fetch_and_and kernel service, fetch_and_or kernel service, compare_and_swap kernel service.
Locking Kernel Services in AIX Kernel Extensions and Device Support Programming Concepts