caigy commented on code in PR #5925:
URL: https://github.com/apache/rocketmq/pull/5925#discussion_r1087865912
##########
common/src/main/java/org/apache/rocketmq/common/UtilAll.java:
##########
@@ -83,15 +84,18 @@ public static int getPid() {
}
public static void sleep(long sleepMs) {
- if (sleepMs < 0) {
+ sleep(sleepMs, TimeUnit.MILLISECONDS);
+ }
+
+ public static void sleep(long timeOut, TimeUnit timeUnit) {
+ if (null == timeUnit) {
return;
}
try {
- Thread.sleep(sleepMs);
- } catch (Throwable ignored) {
+ timeUnit.sleep(timeOut);
+ } catch (InterruptedException ignored) {
Review Comment:
The new version is not equivalent to current version. IMO more relevant
analysis is necessary to confirm this modification will not cause unexpected
effects.
--
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]