Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More than one dependecy for a Task #3

Open
mkuenemann opened this issue Feb 3, 2015 · 0 comments
Open

More than one dependecy for a Task #3

mkuenemann opened this issue Feb 3, 2015 · 0 comments

Comments

@mkuenemann
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant