Allow multiple shutdown calls

This commit is contained in:
ZyX 2013-03-20 00:05:24 +04:00
parent 840ac0109b
commit 0c9337bd72
1 changed files with 3 additions and 2 deletions

View File

@ -45,8 +45,9 @@ class ThreadedSegment(Thread):
self.sleep(monotonic() - start_time) self.sleep(monotonic() - start_time)
def shutdown(self): def shutdown(self):
self.keep_going = False if self.keep_going:
self.update_lock.acquire() self.keep_going = False
self.update_lock.acquire()
def set_interval(self, interval=None): def set_interval(self, interval=None):
# Allowing “interval” keyword in configuration. # Allowing “interval” keyword in configuration.