Skip to content

Commit

Permalink
Merge pull request jenkinsci#4510 from res0nance/double-checked
Browse files Browse the repository at this point in the history
[JENKINS-36720] Fix instances of double checked locking
  • Loading branch information
timja authored Feb 21, 2020
2 parents 824718b + e904ec9 commit 45cf21d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/main/java/hudson/model/ViewJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ public abstract class ViewJob<JobT extends ViewJob<JobT,RunT>, RunT extends Run<
/**
* All {@link Run}s. Copy-on-write semantics.
*/
protected transient /*almost final*/ RunMap<RunT> runs = new RunMap<>();
protected transient volatile /*almost final*/ RunMap<RunT> runs = new RunMap<>(null, null);

private transient boolean notLoaded = true;
private transient volatile boolean notLoaded = true;

/**
* If the reloading of runs are in progress (in another thread,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public abstract class AbstractLazyLoadRunMap<R> extends AbstractMap<Integer,R> i
/**
* Used in {@link #all()} to quickly determine if we've already loaded everything.
*/
private boolean fullyLoaded;
private volatile boolean fullyLoaded;

/**
* Currently visible index.
Expand Down

0 comments on commit 45cf21d

Please sign in to comment.