Re: Sleep, NSWorkspaceWillSleepNotification, 30 seconds and the run loop
Re: Sleep, NSWorkspaceWillSleepNotification, 30 seconds and the run loop
- Subject: Re: Sleep, NSWorkspaceWillSleepNotification, 30 seconds and the run loop
- From: "email@hidden" <email@hidden>
- Date: Wed, 30 Sep 2009 22:16:37 +0100
Not sure though that having called IOCancelPowerChange(,) wether it
can be revoked before the 30 secs are up.
Perhaps a call to IOAllowPowerChange() will be effective.
The above is garbled nonsense
.
I can achieve the desired goal by NOT calling either
IOCancelPowerChange() or IOAllowPowerChange() immediately.
All that is necessary is to have registered for the IOKit notification.
Having done so I have 30 seconds in which to respond with either
IOCancelPowerChange() or IOAllowPowerChange().
So I can trigger my network comms in
void MGSSleepCallBack( void * refCon, io_service_t service, natural_t
messageType, void * messageArgument )
and when done simply call IOAllowPowerChange() to initiate sleep.
Jonathan Mitchell
Developer
http://www.mugginsoft.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden