Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Wiki Markup
Composite operations on shared variables (consisting of more than one discrete operation) must be performed atomically. Errors can arise from composite operations that need to be perceived atomically but are not \[[JLS 05|AA. Java References#JLS 05]\]. Expressions involvingFor example, any assignment that depends on an existing value is a composite operationsoperation, typicallyfor useexample, {{a combination of operators such as, ++, --, +=, *= and /= = b}}.  Increment {{++}} and decrement {{++}} operators depend modify the value of the operand based on the existing value of the operand and are consequently always composite operations.

For atomicity of a grouping of calls to independently atomic methods of the existing Java API, see CON07-J. Do not assume that a grouping of calls to independently atomic methods is atomic.

...