...
CON06-J. Do not defer a thread that is holding a lock
...
| Wiki Markup |
|---|
If a happens-before relationship does not exist between two operations, the JVM is free to reorder them. A data race occurs when a variable is written to by at least one thread and read by a at least oneanother other thread, and the reads and writes are not ordered by a happens-before relationship. A correctly synchronized program is one with no data races. The Java Memory ModeModel guarantees _sequential consistency_ for correctly synchronized programs. Sequential consistency means that the result of any execution is the same as if the reads and writes by all threads on shared data were executed in some sequential order and the operations of each individual thread appear in this sequence in the order specified by its program \[[Tanenbaum 03|AA. Java References#Tanenbaum 03]\]. In other words: |
...