Skip to content

Commit

Permalink
resolve a threadsafe
Browse files Browse the repository at this point in the history
  • Loading branch information
Yrp committed Oct 31, 2018
1 parent a455e38 commit 8dc236e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/main/java/org/tron/core/db2/core/SnapshotRoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

public class SnapshotRoot extends AbstractSnapshot<byte[], byte[]> {

@Getter
private Snapshot solidity;

public SnapshotRoot(String parentName, String name) {
Expand Down Expand Up @@ -85,12 +84,17 @@ public void reset() {
}

@Override
public void resetSolidity() {
public synchronized Snapshot getSolidity() {
return solidity;
}

@Override
public synchronized void resetSolidity() {
solidity = this;
}

@Override
public void updateSolidity() {
public synchronized void updateSolidity() {
solidity = solidity.getNext();
}
}

0 comments on commit 8dc236e

Please sign in to comment.