|
|||||||||||
Technical Support Support Resources
Product Information |
C166: Using the _atomic_ FunctionInformation in this article applies to:
QUESTIONHow can I use the _atomic_ function in my programs to create atomic sections? ANSWERThe _atomic_ and _endatomic_ library routines specify the start and end of an atomic code section. This section of code must be 4 instructions or less. Use atomic sections to protect program code from hardware interrupts. Instructions in an atomic section are executed as an atom and cannot be interrupted. For example:
Generates the following code:
which uses the ATOMIC instruction to protect the specified code. MORE INFORMATION
SEE ALSOLast Reviewed: Thursday, February 25, 2021 | ||||||||||
|
Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.