File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
framework/src/main/java/org/tron/core/services/event Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,8 @@ public class HistoryEventService {
2929 @ Autowired
3030 private Manager manager ;
3131
32+ private volatile boolean isClosed = false ;
33+
3234 private volatile Thread thread ;
3335
3436 public void init () {
@@ -44,6 +46,7 @@ public void init() {
4446 }
4547
4648 public void close () {
49+ isClosed = true ;
4750 if (thread != null ) {
4851 try {
4952 thread .interrupt ();
@@ -61,7 +64,7 @@ private void syncEvent() {
6164 long tmp = instance .getStartSyncBlockNum ();
6265 long endNum = manager .getDynamicPropertiesStore ().getLatestSolidifiedBlockNum ();
6366 while (tmp < endNum ) {
64- if (thread .isInterrupted ()) {
67+ if (thread .isInterrupted () || isClosed ) {
6568 throw new InterruptedException ();
6669 }
6770 if (instance .isUseNativeQueue ()) {
You can’t perform that action at this time.
0 commit comments