Display.Sync () Interrupt

Started by bobjob, July 09, 2010, 05:12:01

Previous topic - Next topic

bobjob

The Display Sync Method currently works something like:
while ( gapTo > timeNow + savedTimeLate ) {
	try {
		Thread.sleep(1);
	} catch (InterruptedException e) {
}


Would it be a problem to put the try block outside of the while loop, so:
try {
	while ( gapTo > timeNow + savedTimeLate ) {
		Thread.sleep(1);
	}
} catch (InterruptedException e) {}

that way another thread can call interrupt to stop the sync method in case a very low frame rate is being used.

the reason Im suggesting this is. In applets the destroy method will only allow for 1000ms in old plugin and 200ms in new plugin.
this can aid in the GL thread finishing itself earlier, to prevent it from getting terminated.

kappa