simplify thread daemon usage
This commit is contained in:
parent
21dfaf7d66
commit
e1c9155ba7
4 changed files with 8 additions and 7 deletions
|
@ -146,8 +146,9 @@ def start_streamer(stream: Any, handler: Callable[[core_pb2.Event], None]) -> No
|
|||
:param handler: function that handles an event
|
||||
:return: nothing
|
||||
"""
|
||||
thread = threading.Thread(target=stream_listener, args=(stream, handler))
|
||||
thread.daemon = True
|
||||
thread = threading.Thread(
|
||||
target=stream_listener, args=(stream, handler), daemon=True
|
||||
)
|
||||
thread.start()
|
||||
|
||||
|
||||
|
|
|
@ -949,8 +949,8 @@ class CoreHandler(socketserver.BaseRequestHandler):
|
|||
file_name,
|
||||
{"__file__": file_name, "coreemu": self.coreemu},
|
||||
),
|
||||
daemon=True,
|
||||
)
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
# allow time for session creation
|
||||
time.sleep(0.25)
|
||||
|
|
|
@ -682,8 +682,9 @@ class EmaneManager(ModelManager):
|
|||
)
|
||||
return
|
||||
self.doeventloop = True
|
||||
self.eventmonthread = threading.Thread(target=self.eventmonitorloop)
|
||||
self.eventmonthread.daemon = True
|
||||
self.eventmonthread = threading.Thread(
|
||||
target=self.eventmonitorloop, daemon=True
|
||||
)
|
||||
self.eventmonthread.start()
|
||||
|
||||
def stopeventmonitor(self) -> None:
|
||||
|
|
|
@ -70,8 +70,7 @@ class EbtablesQueue:
|
|||
return
|
||||
|
||||
self.doupdateloop = True
|
||||
self.updatethread = threading.Thread(target=self.updateloop)
|
||||
self.updatethread.daemon = True
|
||||
self.updatethread = threading.Thread(target=self.updateloop, daemon=True)
|
||||
self.updatethread.start()
|
||||
|
||||
def stopupdateloop(self, wlan: "CoreNetwork") -> None:
|
||||
|
|
Loading…
Reference in a new issue