mirror of
https://github.com/brendanhaines/ECEN5458_Project.git
synced 2024-12-25 18:38:09 -07:00
prevent starting controller multiple times
This commit is contained in:
parent
126e7bf8b0
commit
5da1a5a8c3
|
@ -201,10 +201,13 @@ def cal_black(attrname=None, old=None, new=None):
|
||||||
def start_controller(attrname=None, old=None, new=None):
|
def start_controller(attrname=None, old=None, new=None):
|
||||||
global control_thread
|
global control_thread
|
||||||
global control_thread_run
|
global control_thread_run
|
||||||
control_thread_run = True
|
if control_thread_run:
|
||||||
control_thread = threading.Thread(target=controller)
|
print("ERROR: controller already running")
|
||||||
control_thread.daemon = True
|
else:
|
||||||
control_thread.start()
|
control_thread_run = True
|
||||||
|
control_thread = threading.Thread(target=controller)
|
||||||
|
control_thread.daemon = True
|
||||||
|
control_thread.start()
|
||||||
|
|
||||||
def stop_controller(attrname=None, old=None, new=None):
|
def stop_controller(attrname=None, old=None, new=None):
|
||||||
global control_thread
|
global control_thread
|
||||||
|
|
Loading…
Reference in New Issue
Block a user