Quantcast
Channel: Kodi Community Forum - All Forums
Viewing all articles
Browse latest Browse all 84004

Shutdown Event in XBMC

$
0
0
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:

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

Viewing all articles
Browse latest Browse all 84004

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>