We face some issues with real time clock (RTC) batteries. These are usually old and sometimes one of them dies… or just gets weaker. It’s not really predictable. Whether it’s triggered by a motherboard malfunction, humidity, its age or whatever, it happens. We can replace them, or change the computer but that’s not the matter here.
That’d be very nice if someone knows if failure of the RTC could affect the following functions:
public static native void sleep(long millis) throws InterruptedException;
public final native void wait(long timeout) throws InterruptedException;
public native void park(boolean paramBoolean, long paramLong);
park is in sun.misc.Unsafe
The behavior of these functions probably depends on the operating system and hardware components but it could be… nearly anything. All I know is that it’s a PC, running Windows (XP or later) and using the standard 1.6 JVM. The computer could be up to 10 years old.
I had a look at the open JDK and found that sleep(long millis) is going to WaitForMultipleObjects.
Absolutely no idea on park(boolean paramBoolean, long paramLong) and I got lost trying to understand what’s going on with wait(long timeout).
Easy test. Go to sleep for ten minutes then immediately put the clock forward an hour and see if it wakes up before the full ten minutes is done. That’s probably a damn sight easier than ferreting around in the JDK internals 🙂
But I’ve got to say it. Developers shouldn’t be using ten-year-old hardware and they especially shouldn’t be using faulty hardware.