Commit f11c0a43 authored by yanzg's avatar yanzg

将源码打包进jar包

parent 417ea60b
...@@ -30,7 +30,7 @@ public class Timeout<T> { ...@@ -30,7 +30,7 @@ public class Timeout<T> {
*/ */
public Timeout(T data) { public Timeout(T data) {
this.start = System.currentTimeMillis(); this.start = System.currentTimeMillis();
this.prev = start; this.prev = 0;
this.data = data; this.data = data;
} }
...@@ -65,8 +65,7 @@ public class Timeout<T> { ...@@ -65,8 +65,7 @@ public class Timeout<T> {
if (maxTime >= time) { if (maxTime >= time) {
return false; return false;
} }
long prevMax = Math.max(prev, start + maxTime); long prevTime = now - prev;
long prevTime = now - prevMax;
try { try {
return prevMaxTime > prevTime; return prevMaxTime > prevTime;
} finally { } finally {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment