Merge pull request #711 from croneter/fix-unresponsive

Fix PKC becoming unresponsive
This commit is contained in:
croneter 2019-02-08 15:19:23 +01:00 committed by GitHub
commit a0d6674f7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View file

@ -124,6 +124,9 @@ class App(object):
for thread in self.threads: for thread in self.threads:
if not thread.suspend_reached: if not thread.suspend_reached:
LOG.debug('Waiting for thread to suspend: %s', thread) LOG.debug('Waiting for thread to suspend: %s', thread)
# Send suspend signal again in case self.threads
# changed
thread.suspend()
if self.monitor.waitForAbort(0.1): if self.monitor.waitForAbort(0.1):
return True return True
break break

View file

@ -30,12 +30,12 @@ def double_urldecode(text):
class ImageCachingThread(backgroundthread.KillableThread): class ImageCachingThread(backgroundthread.KillableThread):
def __init__(self): def __init__(self):
super(ImageCachingThread, self).__init__() super(ImageCachingThread, self).__init__()
self.suspend_points = [self._suspended] self.suspend_points = [(self, '_suspended')]
if not utils.settings('imageSyncDuringPlayback') == 'true': if not utils.settings('imageSyncDuringPlayback') == 'true':
self.suspend_points.append(app.APP.is_playing_video) self.suspend_points.append((app.APP, 'is_playing_video'))
def isSuspended(self): def isSuspended(self):
return any(self.suspend_points) return any(getattr(obj, txt) for obj, txt in self.suspend_points)
def _url_generator(self, kind, kodi_type): def _url_generator(self, kind, kodi_type):
""" """