Compound operations are operations that consist of more than one discrete operation. Expressions that include postfix or prefix increment (++
), postfix or prefix decrement (--
), or compound assignment operators always result in compound operations. Compound assignment expressions use operators such as *=, /=, %=, +=, -=, <<=, >>=, >>>=, ^=
and |=
[JLS 2005]. Compound operations on shared variables must be performed atomically to prevent data races and race conditions.
...
[API 2006] | Class |
Item 66. Synchronize access to shared mutable data | |
2.3, Locking | |
[JLS 2005] | |
| §17.4.5, Happens-Before Order |
| §17.4.3, Programs and Program Order |
| §17.4.8, Executions and Causality Requirements |
[Lea 2000] | Section 2.2.7, The Java Memory Model |
| Section 2.1.1.1, Objects and Locks |
07. Visibility and Atomicity (VNA)
...