Add thread names

pull/1496/head
Paulus Schoutsen 2016-03-07 16:43:33 -08:00
parent b67964274b
commit 13d7f742a7
3 changed files with 6 additions and 3 deletions

View File

@ -74,7 +74,8 @@ def setup(hass, config):
hass.bus.listen_once(
ha.EVENT_HOMEASSISTANT_START,
lambda event:
threading.Thread(target=server.start, daemon=True).start())
threading.Thread(target=server.start, daemon=True,
name='HTTP-server').start())
hass.http = server
hass.config.api = rem.API(util.get_local_ip(), api_password, server_port,

View File

@ -775,7 +775,7 @@ def create_timer(hass, interval=TIMER_INTERVAL):
def start_timer(event):
"""Start the timer."""
thread = threading.Thread(target=timer)
thread = threading.Thread(target=timer, name='Timer')
thread.daemon = True
thread.start()

View File

@ -331,7 +331,9 @@ class ThreadPool(object):
if not self.running:
raise RuntimeError("ThreadPool not running")
worker = threading.Thread(target=self._worker)
worker = threading.Thread(
target=self._worker,
name='ThreadPool Worker {}'.format(self.worker_count))
worker.daemon = True
worker.start()