From 70495628c78fc2323bd6892c4e3c1f496ad7730b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Volkan=20=C5=9Eahin?= Date: Mon, 25 Jul 2016 12:19:53 +0300 Subject: [PATCH] timer thread form was changed to daemon --- opt/ahenk/base/timer/setup_timer.py | 4 ++-- opt/ahenk/base/timer/timer.py | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/opt/ahenk/base/timer/setup_timer.py b/opt/ahenk/base/timer/setup_timer.py index c70a1f2..2d16c07 100644 --- a/opt/ahenk/base/timer/setup_timer.py +++ b/opt/ahenk/base/timer/setup_timer.py @@ -4,5 +4,5 @@ from multiprocessing import Process class SetupTimer: @staticmethod def start(timer): - thread_timer = Process(target=timer.run) - thread_timer.start() + timer.setDaemon(True) + timer.start() diff --git a/opt/ahenk/base/timer/timer.py b/opt/ahenk/base/timer/timer.py index 43a7ede..e715bc7 100644 --- a/opt/ahenk/base/timer/timer.py +++ b/opt/ahenk/base/timer/timer.py @@ -1,8 +1,9 @@ import time +import threading - -class Timer: +class Timer(threading.Thread): def __init__(self, timeout, timeout_function, checker_func=None, checker_success_function=None, **kwargs): + threading.Thread.__init__(self) self.timeout = int(timeout) self.timeout_function = timeout_function self.timeout_function_args = None