Skip to content
Permalink
Browse files

[FIXED JENKINS-24358] RunSaveableReference.get can acquire locks, so …

…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 efbdd4d4d9f6f997ef97d7e828a7320f59fbe33a
Showing with 6 additions and 2 deletions.
  1. +6 −2 core/src/main/java/hudson/diagnosis/OldDataMonitor.java
@@ -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());

0 comments on commit efbdd4d

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