提交 42a87abb 编写于 作者: A affe

fix #2020, use wakeup() instead of writing duplicate code

上级 8ef01a6c
...@@ -1407,9 +1407,7 @@ public class CommitLog { ...@@ -1407,9 +1407,7 @@ public class CommitLog {
synchronized (this.requestsWrite) { synchronized (this.requestsWrite) {
this.requestsWrite.add(request); this.requestsWrite.add(request);
} }
if (hasNotified.compareAndSet(false, true)) { this.wakeup();
waitPoint.countDown(); // notify
}
} }
private void swapRequests() { private void swapRequests() {
......
...@@ -260,9 +260,7 @@ public class HAService { ...@@ -260,9 +260,7 @@ public class HAService {
synchronized (this.requestsWrite) { synchronized (this.requestsWrite) {
this.requestsWrite.add(request); this.requestsWrite.add(request);
} }
if (hasNotified.compareAndSet(false, true)) { this.wakeup();
waitPoint.countDown(); // notify
}
} }
public void notifyTransferSome() { public void notifyTransferSome() {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册