• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Sleep, NSWorkspaceWillSleepNotification, 30 seconds and the run loop
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Static Analyzer Question
  • Next by Date: Weird NSToolbar glitch
  • Previous by thread: Re: Strange Core Data save behaviour ("required relationship nil"... when it is set the line before saving)
  • Next by thread: Weird NSToolbar glitch
  • Index(es):
    • Date
    • Thread