3
0
Fork 0
mirror of https://github.com/YosysHQ/sby.git synced 2025-04-05 06:04:06 +00:00

Fix bug in handling of chained tasks

Signed-off-by: Clifford Wolf <clifford@clifford.at>
This commit is contained in:
Clifford Wolf 2018-05-01 14:58:18 +02:00
parent 21d9e5d66f
commit 162bdc9a3b

View file

@ -44,7 +44,7 @@ class SbyTask:
self.output_callback = None
self.exit_callback = None
self.job.tasks_all.append(self)
self.job.tasks_pending.append(self)
def register_dep(self, next_task):
if self.finished:
@ -93,6 +93,7 @@ class SbyTask:
stderr=(subprocess.STDOUT if self.logstderr else None))
fl = fcntl.fcntl(self.p.stdout, fcntl.F_GETFL)
fcntl.fcntl(self.p.stdout, fcntl.F_SETFL, fl | os.O_NONBLOCK)
self.job.tasks_pending.remove(self)
self.job.tasks_running.append(self)
self.running = True
return
@ -155,7 +156,7 @@ class SbyJob:
}
self.tasks_running = []
self.tasks_all = []
self.tasks_pending = []
self.start_clock_time = time()
@ -175,10 +176,10 @@ class SbyJob:
print(line, file=f)
def taskloop(self):
for task in self.tasks_all:
for task in self.tasks_pending:
task.poll()
while len(self.tasks_running):
while len(self.tasks_running) or len(self.tasks_pending):
fds = []
for task in self.tasks_running:
if task.running:
@ -192,6 +193,9 @@ class SbyJob:
for task in self.tasks_running:
task.poll()
for task in self.tasks_pending:
task.poll()
if self.opt_timeout is not None:
total_clock_time = int(time() - self.start_clock_time)
if total_clock_time > self.opt_timeout: