Skip to content

More than one dependecy for a Task #3

@mkuenemann

Description

@mkuenemann

Hi,
I tried the MultiThreadedDAGExecutor with more than one dependency like:
insert(task1, task2);
insert(task2, task3);
insert(task2, task4);
insert(task2, task5);

During excecution the method notifyDone(Runnable task) tries to remove task2 with:
_dependencies.values().remove(task);
This seems not to remove all dependencies for task2, but only one. In docs of Guava it says:

boolean java.util.Collection.remove(Object o):
"Removes a single instance of the specified element from this collection, if it is present (optional operation). "

I tried with:
Iterator<Entry<Runnable, Runnable>> it = _dependencies.entries().iterator();
while (it.hasNext()) {
Entry<Runnable, Runnable> e = it.next();
if (e.getValue().equals(task))
it.remove();
}
That solved the Problem for me.

Kind Regards,
Max

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions