workerpool: Use worker name as thread name
authorMichael Hanselmann <hansmi@google.com>
Wed, 13 Jan 2010 10:38:03 +0000 (11:38 +0100)
committerMichael Hanselmann <hansmi@google.com>
Wed, 13 Jan 2010 13:03:03 +0000 (14:03 +0100)
This way it shows up in debug logs.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>

lib/workerpool.py

index b00efd4..dab4167 100644 (file)
@@ -42,7 +42,7 @@ class BaseWorker(threading.Thread, object):
     @param worker_id: identifier for this worker
 
     """
-    super(BaseWorker, self).__init__()
+    super(BaseWorker, self).__init__(name=worker_id)
     self.pool = pool
     self.worker_id = worker_id
     self._current_task = None