提交 13d8a744 编写于 作者: K Kohsuke Kawaguchi

Ryan reported a dead lock caused by getView(String), so removing synchronized...

Ryan reported a dead lock caused by getView(String), so removing synchronized and requiring the list be concurrently iterable.
上级 f4f41872
......@@ -61,6 +61,9 @@ import java.util.List;
public abstract class ViewGroupMixIn {
private final ViewGroup owner;
/**
* Returns all the views. This list must be concurrently iterable.
*/
protected abstract List<View> views();
protected abstract String primaryView();
protected abstract void primaryView(String newName);
......@@ -86,7 +89,7 @@ public abstract class ViewGroupMixIn {
owner.save();
}
public synchronized View getView(String name) {
public View getView(String name) {
for (View v : views()) {
if(v.getViewName().equals(name))
return v;
......@@ -104,7 +107,7 @@ public abstract class ViewGroupMixIn {
* Gets the read-only list of all {@link View}s.
*/
@Exported
public synchronized Collection<View> getViews() {
public Collection<View> getViews() {
List<View> copy = new ArrayList<View>(views());
Collections.sort(copy, View.SORTER);
return copy;
......
......@@ -1350,7 +1350,7 @@ public class Jenkins extends AbstractCIBase implements ModifiableItemGroup<TopLe
return names;
}
public synchronized View getView(String name) {
public View getView(String name) {
return viewGroupMixIn.getView(name);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册