You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2020/05/25 08:00:21 UTC
[rocketmq] branch develop updated: fix #2020,
use wakeup() instead of writing duplicate code
This is an automated email from the ASF dual-hosted git repository.
jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git
The following commit(s) were added to refs/heads/develop by this push:
new 42a87ab fix #2020, use wakeup() instead of writing duplicate code
new b54681c Merge pull request #2028 from imaffe/affe-0520-use-wakeup
42a87ab is described below
commit 42a87abb97cc1f77febf6bde98dede7018fa3acf
Author: affe <af...@gmail.com>
AuthorDate: Wed May 20 16:20:50 2020 -0700
fix #2020, use wakeup() instead of writing duplicate code
---
store/src/main/java/org/apache/rocketmq/store/CommitLog.java | 4 +---
store/src/main/java/org/apache/rocketmq/store/ha/HAService.java | 4 +---
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
index 82bd670..9d9bbce 100644
--- a/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
+++ b/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
@@ -1407,9 +1407,7 @@ public class CommitLog {
synchronized (this.requestsWrite) {
this.requestsWrite.add(request);
}
- if (hasNotified.compareAndSet(false, true)) {
- waitPoint.countDown(); // notify
- }
+ this.wakeup();
}
private void swapRequests() {
diff --git a/store/src/main/java/org/apache/rocketmq/store/ha/HAService.java b/store/src/main/java/org/apache/rocketmq/store/ha/HAService.java
index 3035c57..69f8526 100644
--- a/store/src/main/java/org/apache/rocketmq/store/ha/HAService.java
+++ b/store/src/main/java/org/apache/rocketmq/store/ha/HAService.java
@@ -260,9 +260,7 @@ public class HAService {
synchronized (this.requestsWrite) {
this.requestsWrite.add(request);
}
- if (hasNotified.compareAndSet(false, true)) {
- waitPoint.countDown(); // notify
- }
+ this.wakeup();
}
public void notifyTransferSome() {