Wiki Markup |
---|
Compound operations on shared variables (consisting of more than one discrete operation) must be performed atomically. Errors can arise from compound operations that need to be perceived atomically but are not \[[JLS 05|AA. Java References#JLS 05]\]. |
Expressions that include postfix and prefix increment (++
), postfix or prefix decrement (--
), or compound assignment operators always result in compound operations. Compound assignment expressions include operators *=, /=, %=, +=, -=, <<=, >>=, >>>=, ^=, or |=
. The postfix and prefix increment (++
) and decrement (--
) operations can also be treated as compound expressions.
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.
...