timer thread form was changed to daemon

This commit is contained in:
Volkan Şahin 2016-07-25 12:19:53 +03:00
parent bf9af4042a
commit 70495628c7
2 changed files with 5 additions and 4 deletions

View file

@ -4,5 +4,5 @@ from multiprocessing import Process
class SetupTimer: class SetupTimer:
@staticmethod @staticmethod
def start(timer): def start(timer):
thread_timer = Process(target=timer.run) timer.setDaemon(True)
thread_timer.start() timer.start()

View file

@ -1,8 +1,9 @@
import time import time
import threading
class Timer(threading.Thread):
class Timer:
def __init__(self, timeout, timeout_function, checker_func=None, checker_success_function=None, **kwargs): def __init__(self, timeout, timeout_function, checker_func=None, checker_success_function=None, **kwargs):
threading.Thread.__init__(self)
self.timeout = int(timeout) self.timeout = int(timeout)
self.timeout_function = timeout_function self.timeout_function = timeout_function
self.timeout_function_args = None self.timeout_function_args = None