未验证 提交 b54681cc 编写于 作者: R rongtong 提交者: GitHub

Merge pull request #2028 from imaffe/affe-0520-use-wakeup

[ISSUE #2020] Use wakeup() instead of writing duplicate code
...@@ -1404,9 +1404,7 @@ public class CommitLog { ...@@ -1404,9 +1404,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() {
......
...@@ -261,9 +261,7 @@ public class HAService { ...@@ -261,9 +261,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.
先完成此消息的编辑!
想要评论请 注册