Commit ccedb11b authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

workerpool: Remove unused worker method



HasRunningTask is never used except for an assertion, where we
don't really need the lock.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 21c5ad52
......@@ -63,16 +63,6 @@ class BaseWorker(threading.Thread, object):
"""
return (self._current_task is not None)
def HasRunningTask(self):
"""Returns whether this worker is currently running a task.
"""
self.pool._lock.acquire()
try:
return self._HasRunningTaskUnlocked()
finally:
self.pool._lock.release()
def run(self):
"""Main thread function.
......@@ -81,7 +71,7 @@ class BaseWorker(threading.Thread, object):
"""
pool = self.pool
assert not self.HasRunningTask()
assert self._current_task is None
while True:
try:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment