xiaoyifang commented on code in PR #5713:
URL: https://github.com/apache/rocketmq/pull/5713#discussion_r1052014487
##########
common/src/main/java/org/apache/rocketmq/common/ServiceThread.java:
##########
@@ -133,13 +149,17 @@ protected void waitForRunning(long interval) {
}
//entry to wait
- waitPoint.reset();
-
+ lock.lock();
try {
- waitPoint.await(interval, TimeUnit.MILLISECONDS);
+ if (!hasNotified.get())
+ {
+ //ignore return value
+ waitPoint.await(interval, TimeUnit.MILLISECONDS);
+ }
} catch (InterruptedException e) {
log.error("Interrupted", e);
} finally {
+ lock.unlock();
Review Comment:
can you show me a more detailed execution order.
should this line `if (!hasNotified.get())` be enough?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]