Fixed blocker bug

This commit is contained in:
Joshua Ogunyinka
2019-08-20 13:14:39 +01:00
parent 3673de2fcc
commit 764739f2cb
3 changed files with 17 additions and 10 deletions

View File

@@ -112,9 +112,11 @@ class InputHelper(object):
if task_name == new_task_name:
return task_block
# otherwise pre-process all the commands in this new `new_task_name` block
for task in InputHelper._pre_process_commands(command_list, new_task_name, False):
tasks = InputHelper._pre_process_commands(command_list, new_task_name, False)
for task in tasks:
task_block.append(task)
sibling = task
if len(tasks) > 0:
sibling = tasks[-1]
continue
else:
# if a blocker is encountered, all commands following the blocker must wait until the last
@@ -126,10 +128,10 @@ class InputHelper(object):
# if we're in the global scope and there was a previous _blocker_ encountered, we wait for the last
# child of the block
if is_global_task and global_task:
task.wait_for(global_task.get_lock())
task.wait_for(task_block)
# all but the first command in a block scope wait for its predecessor
elif sibling and not is_global_task:
task.wait_for(sibling.get_lock())
task.wait_for([sibling])
task_block.append(task)
sibling = task
return task_block