不好的设计

This commit is contained in:
徐建海
2016-10-06 15:48:05 +08:00
committed by GitHub
parent 5d9d5b1e44
commit 006dd63646

View File

@@ -388,7 +388,10 @@ public abstract class AbstractEventParser<EVENT> extends AbstractCanalLifeCycle
String name = String.format("destination = %s , address = %s , HeartBeatTimeTask",
destination,
runningInfo == null ? null : runningInfo.getAddress().toString());
synchronized (MysqlEventParser.class) {
// synchronized(AbstractEventParser.class){
// synchronized (MysqlEventParser.class) {
// why use MysqlEventParser.class, u know, MysqlEventParser is the child class 4 AbstractEventParser,
// do this is ...
if (timer == null) {
timer = new Timer(name, true);
}