forked from openlp/openlp
Insert timeout on acquiring lock in slidecontroller to avoid hang. Fixes bug 1413324.
Fixes: https://launchpad.net/bugs/1413324
This commit is contained in:
parent
b3fd23da59
commit
7e406e7005
@ -1069,8 +1069,13 @@ class SlideController(DisplayController, RegistryProperties):
|
||||
:param start:
|
||||
"""
|
||||
# Only one thread should be in here at the time. If already locked just skip, since the update will be
|
||||
# done by the thread holding the lock. If it is a "start" slide, we must wait for the lock.
|
||||
if not self.slide_selected_lock.acquire(start):
|
||||
# done by the thread holding the lock. If it is a "start" slide, we must wait for the lock, but only for 0.2
|
||||
# seconds, since we don't want to cause a deadlock
|
||||
timeout = 0.2 if start else -1
|
||||
if not self.slide_selected_lock.acquire(start, timeout):
|
||||
if start:
|
||||
self.log_debug('Could not get lock in slide_selected after waiting %f, skip to avoid deadlock.'
|
||||
% timeout)
|
||||
return
|
||||
row = self.preview_widget.current_slide_number()
|
||||
self.selected_row = 0
|
||||
|
Loading…
Reference in New Issue
Block a user