Hello,
I am currently in the process of developing an addon that automatically wake ups my fileserver when XBMC starts up and sends it to hibernate mode when XBMC shuts down.
Therefore I implemented a service according to the guidelines in the wiki. Currently the service is implemented like this:
This however raises my CPU usage to 100% probably rendering XBMC unusable on single core systems (my setup consists of a dual core system so XBMC still runs smoothly). My question are:
What would be the most elegant way to wait for the XBMC to shut down? Is there a sleep command that can be configured more fine-grained than only seconds (like with time.sleep())?
Or is there even a hook that gets called whenever XBMC shuts down so that I can replace the while-loop?
Thanks in advance
lagwagon667
I am currently in the process of developing an addon that automatically wake ups my fileserver when XBMC starts up and sends it to hibernate mode when XBMC shuts down.
Therefore I implemented a service according to the guidelines in the wiki. Currently the service is implemented like this:
Code:
wakeupServer()
while (not xbmc.abortRequested):
x = 0
# do anything useless
shutdownServer()
This however raises my CPU usage to 100% probably rendering XBMC unusable on single core systems (my setup consists of a dual core system so XBMC still runs smoothly). My question are:
What would be the most elegant way to wait for the XBMC to shut down? Is there a sleep command that can be configured more fine-grained than only seconds (like with time.sleep())?
Or is there even a hook that gets called whenever XBMC shuts down so that I can replace the while-loop?
Thanks in advance
lagwagon667