IntelliJ contains this message ...
"This inspection reports on any instances of while loops which spin on the value of a non-volatile field, waiting for it to be changed by another
thread. In addition to being potentially extremely CPU intensive when little work is done inside the loop, such loops are likely have different semantics than intended, as the
Java Memory Model allows such field accesses to be hoisted out of the loop, causing the loop to never complete even if another thread does change the field's value."
I'm thinking this may be causing a problem in the current code, but I don't understand the part about "the Java Memory Model allows such field accesses to be hoisted out of the loop".
How do you hoist a field out of the loop?