Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWinston Prakash2012-02-27 14:13:50 -0500
committerWinston Prakash2012-02-27 14:13:50 -0500
commit6174d4d22170ca06118421e1e69cf44d11e3b831 (patch)
tree04cc395a17cf47e5dfefca8984c80c437ebba40d
parent4f259a46b46bbb1b5db456191e2d7157b91eff31 (diff)
downloadorg.eclipse.hudson.core-6174d4d22170ca06118421e1e69cf44d11e3b831.tar.gz
org.eclipse.hudson.core-6174d4d22170ca06118421e1e69cf44d11e3b831.tar.xz
org.eclipse.hudson.core-6174d4d22170ca06118421e1e69cf44d11e3b831.zip
Add synchronized to make the operation on Slave Label thread safe
-rw-r--r--hudson-core/src/main/java/hudson/model/Label.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/hudson-core/src/main/java/hudson/model/Label.java b/hudson-core/src/main/java/hudson/model/Label.java
index 445befb2..276238ef 100644
--- a/hudson-core/src/main/java/hudson/model/Label.java
+++ b/hudson-core/src/main/java/hudson/model/Label.java
@@ -158,7 +158,7 @@ public abstract class Label extends Actionable implements Comparable<Label>, Mod
* Gets all {@link Node}s that belong to this label.
*/
@Exported
- public Set<Node> getNodes() {
+ public synchronized Set<Node> getNodes() {
Set<Node> nodes = this.nodes;
if(nodes!=null) return nodes;
@@ -177,7 +177,7 @@ public abstract class Label extends Actionable implements Comparable<Label>, Mod
* Gets all {@link Cloud}s that can launch for this label.
*/
@Exported
- public Set<Cloud> getClouds() {
+ public synchronized Set<Cloud> getClouds() {
if(clouds==null) {
Set<Cloud> r = new HashSet<Cloud>();
Hudson h = Hudson.getInstance();

Back to the top