signalling suspend/resume events (deviceKit-power)

Richard Hughes hughsient at gmail.com
Tue Dec 8 06:51:02 PST 2009


2009/12/8 Dario Freddi <drf54321 at gmail.com>:
> But I think a better idea would be having the signal being streamed from
> upower (since if the aim is providing an unique and future-proof system),
> triggered from an hook in pm-utils. I think such a solution would be the best
> of both worlds.

You have to be careful with signals, as they are not blocking, I mean:

user clicks suspend
upower sends Suspending()
_______________________

pc is sleeping
_______________________

pc awakes
upower sends Awakening()
_______________________

Applications get time to process the Suspending signal call.
Applications get time to process the Awakening signal call.

So you get a nice race.

Richard.


More information about the devkit-devel mailing list