synchronized (hudson) {
// this synchronization block is so that we don't end up adding the same slave name more than once.
int sz = hudson.getNodes().size();
DumbSlave slave = new DumbSlave("slave" + sz, "dummy",
createTmpDir().getPath(), "1", Mode.NORMAL, labels==null?"":labels, createComputerLauncher(env), RetentionStrategy.NOOP, Collections.EMPTY_LIST);
hudson.addNode(slave);
return slave;
}
}