提交 5ef293d7 编写于 作者: D Daniel Beck

Merge pull request #1176 from jkolash/master

[FIXED JENKINS-17667] - Syncronization of InstallerTranslator::getToolHome() 
......@@ -50,16 +50,22 @@ public class InstallerTranslator extends ToolLocationTranslator {
if (isp == null) {
return null;
}
for (ToolInstaller installer : isp.installers) {
if (installer.appliesTo(node)) {
Map<ToolInstallation, Semaphore> mutexByTool = mutexByNode.get(node);
if (mutexByTool == null) {
mutexByNode.put(node, mutexByTool = new WeakHashMap<ToolInstallation, Semaphore>());
}
Semaphore semaphore = mutexByTool.get(tool);
if (semaphore == null) {
mutexByTool.put(tool, semaphore = new Semaphore(1));
Map<ToolInstallation, Semaphore> mutexByTool;
Semaphore semaphore;
synchronized(mutexByNode) {
mutexByTool = mutexByNode.get(node);
if (mutexByTool == null) {
mutexByNode.put(node, mutexByTool = new WeakHashMap<ToolInstallation, Semaphore>());
mutexByTool.put(tool, semaphore = new Semaphore(1));
} else {
semaphore = mutexByTool.get(tool);
}
}
semaphore.acquire();
try {
return installer.performInstallation(tool, node, log).getRemote();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册