|
|
@ -95,7 +95,10 @@ public class RedissonLock implements Lock {
|
|
|
|
while (!tryLock()) {
|
|
|
|
while (!tryLock()) {
|
|
|
|
long current = System.currentTimeMillis();
|
|
|
|
long current = System.currentTimeMillis();
|
|
|
|
// waiting for message
|
|
|
|
// waiting for message
|
|
|
|
msg.tryAcquire(time, TimeUnit.MILLISECONDS);
|
|
|
|
boolean res = msg.tryAcquire(time, TimeUnit.MILLISECONDS);
|
|
|
|
|
|
|
|
if (res) {
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
long elapsed = System.currentTimeMillis() - current;
|
|
|
|
long elapsed = System.currentTimeMillis() - current;
|
|
|
|
time -= elapsed;
|
|
|
|
time -= elapsed;
|
|
|
|
if (time <= 0) {
|
|
|
|
if (time <= 0) {
|
|
|
|