mirror of
https://github.com/meshtastic/python.git
synced 2026-09-15 06:52:41 -04:00
deferred execution thread should be named and marked as daemon
This commit is contained in:
1 parent
d1aadf0c8e
commit
f8ad4fef7c
1 file changed
+3
-2
+3
-2
@@ -266,9 +266,10 @@ class Acknowledgment:
|
||||
class DeferredExecution:
|
||||
"""A thread that accepts closures to run, and runs them as they are received"""
|
||||
|
||||
def __init__(self, name=None):
|
||||
def __init__(self, name):
|
||||
self.queue = Queue()
|
||||
self.thread = threading.Thread(target=self._run, args=(), name=name)
|
||||
# this thread must be marked as daemon, otherwise it will prevent clients from exiting
|
||||
self.thread = threading.Thread(target=self._run, args=(), name=name, daemon=True)
|
||||
self.thread.daemon = True
|
||||
self.thread.start()
|
||||
|
||||
|
||||
Reference in new issue
Block a user