While loop bug? Stuck on empty

Hi,

Yeas, nextMove is changed in another thread that is listening for serial feedback from the plotter.
As I mentioned the loop functions as intended if the print statement is uncommented but if the statement is commented out it gets stuck. Which seems a bit odd to me.

Does that make sense?

On another note - I realised I was setting needlessly printOnce each time so I moved it into the if statement as below.

    nextMove=false;                            // tell loop plotter is busy
    boolean printOnce = true;                  // control for busy message
    while (nextMove == false) {                // wait for plotter not to be busy
      if(printOnce){
        println("Waiting for plotter to move home");      //print busy message
        printOnce = false;
      }
      println("Stuck in while loop");
      
    }