Skip to content

Commit

Permalink
[FIXED JENKINS-24358] RunSaveableReference.get can acquire locks, so …
Browse files Browse the repository at this point in the history
…avoid calling it while holding a lock on ourselves.

(cherry picked from commit 5fea6cb)

Conflicts:
	changelog.html
  • Loading branch information
jglick authored and olivergondza committed Sep 7, 2014
1 parent 8d81020 commit efbdd4d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/main/java/hudson/diagnosis/OldDataMonitor.java
Expand Up @@ -84,9 +84,13 @@ public boolean isActivated() {
return !data.isEmpty();
}

public synchronized Map<Saveable,VersionRange> getData() {
public Map<Saveable,VersionRange> getData() {
Map<SaveableReference,VersionRange> _data;
synchronized (this) {
_data = new HashMap<SaveableReference,VersionRange>(this.data);
}
Map<Saveable,VersionRange> r = new HashMap<Saveable,VersionRange>();
for (Map.Entry<SaveableReference,VersionRange> entry : data.entrySet()) {
for (Map.Entry<SaveableReference,VersionRange> entry : _data.entrySet()) {
Saveable s = entry.getKey().get();
if (s != null) {
r.put(s, entry.getValue());
Expand Down

0 comments on commit efbdd4d

Please sign in to comment.