Fixed a possible race condition in Transport startup when a local shared instance was restarted and client apps reconnect

This commit is contained in:
Mark Qvist 2022-04-17 19:34:12 +02:00
parent 5f36c8601f
commit cc0c01661d

View File

@ -121,6 +121,7 @@ class Transport:
@staticmethod
def start(reticulum_instance):
Transport.jobs_running = True
Transport.owner = reticulum_instance
if Transport.identity == None:
@ -155,6 +156,7 @@ class Transport:
Transport.control_destinations.append(Transport.tunnel_synthesize_handler)
Transport.control_hashes.append(Transport.tunnel_synthesize_destination.hash)
Transport.jobs_running = False
thread = threading.Thread(target=Transport.jobloop)
thread.setDaemon(True)
thread.start()