Shared variable
Global variables shared between multiple tasks and protected from concurrent access by the tasks
Description
A shared protected global variable has the following properties:
The variable is used in more than one task.
All operations on the variable are protected from interruption through critical sections or temporal exclusion. The calls to functions beginning and ending a critical section must be reachable.
In code that is not intended for multitasking, all global variables are non-shared.
In your verification results, these variables are colored green on the Source, Results List and Variable Access panes. On the Source pane, the coloring is applied to the variable only during declaration.
Examples
Check Information
Language: C | C++ |
See Also
Show global variable sharing and usage only
(-shared-variables-mode)
| Temporally exclusive tasks (-temporal-exclusions-file)
| Critical section details (-critical-section-begin -critical-section-end)
| Tasks (-entry-points)
| Potentially unprotected variable
| Used non-shared variable
| Unused variable