10 messages in net.java.dev.jna.usersRe: [jna-users] Re: Kernel32 Waking H...
FromSent OnAttachments
Dale...@coats.comApr 24, 2008 6:34 pm 
Dale...@coats.comApr 28, 2008 5:01 pm 
Timothy WallApr 29, 2008 10:13 am 
Dale...@coats.comApr 30, 2008 9:24 am 
Dale...@coats.comApr 30, 2008 10:10 am 
Timothy WallMay 1, 2008 5:58 am 
Dale...@coats.comMay 1, 2008 7:37 am 
Timothy WallMay 1, 2008 8:07 am 
Timothy WallMay 1, 2008 8:35 am 
Dale...@coats.comMay 1, 2008 10:12 am 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Re: Kernel32 Waking Hibernating MachineActions...
From:Timothy Wall (twal@dev.java.net)
Date:Apr 29, 2008 10:13:46 am
List:net.java.dev.jna.users

You might check to see if the VM itself is set up to respond to any OS signals (like sleep). There is also an -Xrs switch to the VM to reduce the VM's use of OS signals.

You should also check to see if there are any "minor" wake from sleep dependencies or requirements that you might have overlooked in the w32 api.

Other than having more dependent dlls, I don't see any difference between your mapping and a simple C program.

On Apr 28, 2008, at 8:01 PM, Dale@coats.com wrote:

This same technique works when coded in C language, so I think it must be something different in the way JNA handles it.

HANDLE htimer = kernel32.CreateWaitableTimer(null, true, "MyWaitableTimer"); boolean setTimerResult = kernel32.SetWaitableTimer(htimer, pDueTime, 0L,null, null, true); int waitResult = kernel32.WaitForSingleObject(htimer,Integer.MAX_VALUE);

The last line, above, appropriately blocks execution, even in the JNA version, then continues after the timer fires, when the machine is awake. The difference is that if the machine is sleeping, only the C version wakes the machine when the timer fires, the JNA version does not.

Anybody have any clues, or am I outta luck?

--Dale--