Skip to content

Commit

Permalink
remove redundant volatile (#329)
Browse files Browse the repository at this point in the history
* perf: remove redundant volatile

* fix: leaderInfo should be use volatile

* fix: recover these variables are use volatile that the get method is not protect by synchronized.

* fix: the get method of pushedVersion and attributes is not protect by synchronized when in print log.
  • Loading branch information
ashlee618 authored Jul 8, 2023
1 parent 808b7dc commit 4d3e142
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public abstract class AbstractLeaderElector implements LeaderElector {

private volatile boolean startElector = false;

private volatile boolean isObserver = false;
private boolean isObserver = false;

private final LeaderElectorTrigger leaderElectorTrigger = new LeaderElectorTrigger();

Expand Down

0 comments on commit 4d3e142

Please sign in to comment.