Skip to content

Commit

Permalink
Reading the addon graph must be performed in a READ Lock
Browse files Browse the repository at this point in the history
  • Loading branch information
lincolnthree committed Sep 6, 2013
1 parent 0cc26b0 commit 8db8be1
Showing 1 changed file with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,25 @@ public ServiceRegistry getServiceRegistryOf(Addon addon)
return getState(addon).getServiceRegistry();
}

public Set<AddonView> getViewsOf(Addon addon)
public Set<AddonView> getViewsOf(final Addon addon)
{
Set<AddonView> result = new HashSet<AddonView>();
for (AddonVertex vertex : graph.getGraph().vertexSet())
return lock.performLocked(LockMode.READ, new Callable<Set<AddonView>>()
{
if (addon.equals(vertex.getAddon()))
@Override
public Set<AddonView> call() throws Exception
{
result.addAll(vertex.getViews());
break;
Set<AddonView> result = new HashSet<AddonView>();
for (AddonVertex vertex : graph.getGraph().vertexSet())
{
if (addon.equals(vertex.getAddon()))
{
result.addAll(vertex.getViews());
break;
}
}
return result;
}
}
return result;
});
}

private AddonState getState(final Addon addon)
Expand Down

0 comments on commit 8db8be1

Please sign in to comment.