Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
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





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




Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.