Ada Programming/Pragmas/Shared

pragma Shared (local_name);

Summary
Shared is an Ada 83 representation pragma equivalent to Atomic. However, it can only be applied to variables, whereas Atomic can also be used with types.

It was removed from the language in Ada 95 for several reasons:
 * it was not properly defined
 * it couldn't be applied to arrays
 * the name Shared was confusing

In Ada 95 pragma Shared was replaced by pragma Atomic, Volatile, Atomic_Components, and Volatile_Components.

Portability
Shared is a standard pragma of Ada 83, so it must be implemented by all Ada 83 compilers. It is obsolescent in successive versions of the language, but it is equivalent to pragma Atomic and thus it is usually implemented by Ada 95 compilers for compatibility.

Example
Device_Status : Status_Register; (Device_Status);

Incorrect usage
It is usually unsafe to use shared variables for tasking.

Wikibook

 * Ada Programming
 * Ada Programming/Ada 83
 * Ada Programming/Pragmas
 * Ada Programming/Pragmas/Atomic
 * Ada Programming/Pragmas/Volatile
 * Ada Programming/Pragmas/Atomic Components
 * Ada Programming/Pragmas/Volatile Components