-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Closed
Description
GroupCommitService#swapRequests has used lock
rocketmq/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
Lines 1461 to 1470 in f8bf7bd
private void swapRequests() { | |
lock.lock(); | |
try { | |
LinkedList<GroupCommitRequest> tmp = this.requestsWrite; | |
this.requestsWrite = this.requestsRead; | |
this.requestsRead = tmp; | |
} finally { | |
lock.unlock(); | |
} | |
} |
this code chunk used synchronized
rocketmq/store/src/main/java/org/apache/rocketmq/store/CommitLog.java
Lines 1519 to 1521 in f8bf7bd
synchronized (this) { | |
this.swapRequests(); | |
} |
synchronized can be removed