Skip to content
Permalink
Browse files

Merge pull request #3198 from johnou/contention-JENKINS-48505

[JENKINS-48505] - Invoke optimistic get before computeIfAbsent to avoid contention.
  • Loading branch information...
oleg-nenashev committed Dec 16, 2017
2 parents 09bcc5d + dce450e commit 3a529636cfc64cc6ea454d55ca88fd7a1f7981a5
Showing with 2 additions and 1 deletion.
  1. +2 −1 core/src/main/java/jenkins/model/Jenkins.java
@@ -2595,7 +2595,8 @@ public Injector getInjector() {
*/
@SuppressWarnings({"unchecked"})
public <T> ExtensionList<T> getExtensionList(Class<T> extensionType) {
return extensionLists.computeIfAbsent(extensionType, key -> ExtensionList.create(this, key));
ExtensionList<T> extensionList = extensionLists.get(extensionType);
return extensionList != null ? extensionList : extensionLists.computeIfAbsent(extensionType, key -> ExtensionList.create(this, key));
}

/**

0 comments on commit 3a52963

Please sign in to comment.
You can’t perform that action at this time.