My thread fall asleep since update!

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]

Nothing has changed that might affect that.

Try breakpointing it and stepping through with the debugger.

@methusalah said: Hi,

I experiment a strange issue with a thread, since the update of my jMonkey lib from 2011 release to recent nightly build.

If you were running 2 years old code it’s probably dying from something else.

I agree with the others. You’ve left out the important part of the code… the part that is actually failing.