mirror of
https://github.com/brendanhaines/ECEN5458_Project.git
synced 2025-07-11 13:15:57 -06:00
prevent starting controller multiple times
This commit is contained in:
@ -201,6 +201,9 @@ 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
|
||||||
|
if control_thread_run:
|
||||||
|
print("ERROR: controller already running")
|
||||||
|
else:
|
||||||
control_thread_run = True
|
control_thread_run = True
|
||||||
control_thread = threading.Thread(target=controller)
|
control_thread = threading.Thread(target=controller)
|
||||||
control_thread.daemon = True
|
control_thread.daemon = True
|
||||||
|
Reference in New Issue
Block a user