I am waiting for a boolean to change with the while loop, but the while loop never ends? I'm probably somehow stupid about this
Code that does work. but the while loop never ends and my code when the boolean has changed doesn't get executed:
while(!myCoolBoolean);
//my code when the boolean has changed to true
It's a bit weird, because it works when I do:
while(!myCoolBoolean) {
System.out.print();
}
//my code again
Any help? EDIT: The while loop is actually in a thread, and myCoolBoolean is being changed in an another thread