Hi,
I experiment a strange issue with a thread, since the update of my jMonkey lib from 2011 release to recent nightly build.
My thread starts correctly, and execute it’s inifinte loop once. The thread have no reason to end. But since the update, the thread seems to fall asleep !
I’ve included a log command to debug it, and with this command, it worked normaly again.
I don’t know the thread mechanism very well, but I would like to understand what have changed between the two jMonkey versions that could produce that strange effect. Is there some kind of infinite loop detection?
[java]@Override
public void run() {
while (!finished) {
// If I don’t use that command, the thread seems to fall asleep.
LogUtil.logger.info("");
if (Condition) {
// The Condition is changed by a synchronized method (see below).
// That code is reached only once.
}
}
// That code is never reached
}
public synchronized void changeContition() {
Condition = true;
}
[/java]