2022-06-10 21:38:30 +09:00

1959 lines
46 KiB
Smali

.class public final Lcom/google/common/util/concurrent/Monitor;
.super Ljava/lang/Object;
.source "Monitor.java"
# annotations
.annotation build Lcom/google/common/annotations/Beta;
.end annotation
.annotation build Lcom/google/common/annotations/GwtIncompatible;
.end annotation
.annotation runtime Lcom/google/common/util/concurrent/ElementTypesAreNonnullByDefault;
.end annotation
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/google/common/util/concurrent/Monitor$Guard;
}
.end annotation
# instance fields
.field private activeGuards:Lcom/google/common/util/concurrent/Monitor$Guard;
.annotation build Lcom/google/errorprone/annotations/concurrent/GuardedBy;
value = "lock"
.end annotation
.annotation runtime Ljavax/annotation/CheckForNull;
.end annotation
.end field
.field private final fair:Z
.field private final lock:Ljava/util/concurrent/locks/ReentrantLock;
# direct methods
.method public constructor <init>()V
.locals 1
const/4 v0, 0x0
.line 1
invoke-direct {p0, v0}, Lcom/google/common/util/concurrent/Monitor;-><init>(Z)V
return-void
.end method
.method public constructor <init>(Z)V
.locals 1
.line 2
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, 0x0
.line 3
iput-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->activeGuards:Lcom/google/common/util/concurrent/Monitor$Guard;
.line 4
iput-boolean p1, p0, Lcom/google/common/util/concurrent/Monitor;->fair:Z
.line 5
new-instance v0, Ljava/util/concurrent/locks/ReentrantLock;
invoke-direct {v0, p1}, Ljava/util/concurrent/locks/ReentrantLock;-><init>(Z)V
iput-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
return-void
.end method
.method public static synthetic access$000(Lcom/google/common/util/concurrent/Monitor;)Ljava/util/concurrent/locks/ReentrantLock;
.locals 0
.line 1
iget-object p0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
return-object p0
.end method
.method private await(Lcom/google/common/util/concurrent/Monitor$Guard;Z)V
.locals 0
.annotation build Lcom/google/errorprone/annotations/concurrent/GuardedBy;
value = "lock"
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;
}
.end annotation
if-eqz p2, :cond_0
.line 1
invoke-direct {p0}, Lcom/google/common/util/concurrent/Monitor;->signalNextWaiter()V
.line 2
:cond_0
invoke-direct {p0, p1}, Lcom/google/common/util/concurrent/Monitor;->beginWaitingFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
.line 3
:cond_1
:try_start_0
iget-object p2, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->condition:Ljava/util/concurrent/locks/Condition;
invoke-interface {p2}, Ljava/util/concurrent/locks/Condition;->await()V
.line 4
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result p2
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz p2, :cond_1
.line 5
invoke-direct {p0, p1}, Lcom/google/common/util/concurrent/Monitor;->endWaitingFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
return-void
:catchall_0
move-exception p2
invoke-direct {p0, p1}, Lcom/google/common/util/concurrent/Monitor;->endWaitingFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
.line 6
throw p2
.end method
.method private awaitNanos(Lcom/google/common/util/concurrent/Monitor$Guard;JZ)Z
.locals 4
.annotation build Lcom/google/errorprone/annotations/concurrent/GuardedBy;
value = "lock"
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;
}
.end annotation
const/4 v0, 0x1
move v1, v0
:cond_0
const-wide/16 v2, 0x0
cmp-long v2, p2, v2
const/4 v3, 0x0
if-gtz v2, :cond_2
if-nez v1, :cond_1
.line 1
invoke-direct {p0, p1}, Lcom/google/common/util/concurrent/Monitor;->endWaitingFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
:cond_1
return v3
:cond_2
if-eqz v1, :cond_4
if-eqz p4, :cond_3
.line 2
:try_start_0
invoke-direct {p0}, Lcom/google/common/util/concurrent/Monitor;->signalNextWaiter()V
.line 3
:cond_3
invoke-direct {p0, p1}, Lcom/google/common/util/concurrent/Monitor;->beginWaitingFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
move v1, v3
.line 4
:cond_4
iget-object v2, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->condition:Ljava/util/concurrent/locks/Condition;
invoke-interface {v2, p2, p3}, Ljava/util/concurrent/locks/Condition;->awaitNanos(J)J
move-result-wide p2
.line 5
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result v2
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz v2, :cond_0
if-nez v1, :cond_5
.line 6
invoke-direct {p0, p1}, Lcom/google/common/util/concurrent/Monitor;->endWaitingFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
:cond_5
return v0
:catchall_0
move-exception p2
if-nez v1, :cond_6
invoke-direct {p0, p1}, Lcom/google/common/util/concurrent/Monitor;->endWaitingFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
.line 7
:cond_6
throw p2
.end method
.method private awaitUninterruptibly(Lcom/google/common/util/concurrent/Monitor$Guard;Z)V
.locals 0
.annotation build Lcom/google/errorprone/annotations/concurrent/GuardedBy;
value = "lock"
.end annotation
if-eqz p2, :cond_0
.line 1
invoke-direct {p0}, Lcom/google/common/util/concurrent/Monitor;->signalNextWaiter()V
.line 2
:cond_0
invoke-direct {p0, p1}, Lcom/google/common/util/concurrent/Monitor;->beginWaitingFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
.line 3
:cond_1
:try_start_0
iget-object p2, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->condition:Ljava/util/concurrent/locks/Condition;
invoke-interface {p2}, Ljava/util/concurrent/locks/Condition;->awaitUninterruptibly()V
.line 4
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result p2
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz p2, :cond_1
.line 5
invoke-direct {p0, p1}, Lcom/google/common/util/concurrent/Monitor;->endWaitingFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
return-void
:catchall_0
move-exception p2
invoke-direct {p0, p1}, Lcom/google/common/util/concurrent/Monitor;->endWaitingFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
.line 6
throw p2
.end method
.method private beginWaitingFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
.locals 2
.annotation build Lcom/google/errorprone/annotations/concurrent/GuardedBy;
value = "lock"
.end annotation
.line 1
iget v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->waiterCount:I
add-int/lit8 v1, v0, 0x1
iput v1, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->waiterCount:I
if-nez v0, :cond_0
.line 2
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->activeGuards:Lcom/google/common/util/concurrent/Monitor$Guard;
iput-object v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->next:Lcom/google/common/util/concurrent/Monitor$Guard;
.line 3
iput-object p1, p0, Lcom/google/common/util/concurrent/Monitor;->activeGuards:Lcom/google/common/util/concurrent/Monitor$Guard;
:cond_0
return-void
.end method
.method private endWaitingFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
.locals 4
.annotation build Lcom/google/errorprone/annotations/concurrent/GuardedBy;
value = "lock"
.end annotation
.line 1
iget v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->waiterCount:I
add-int/lit8 v0, v0, -0x1
iput v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->waiterCount:I
if-nez v0, :cond_2
.line 2
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->activeGuards:Lcom/google/common/util/concurrent/Monitor$Guard;
const/4 v1, 0x0
move-object v2, v1
:goto_0
if-ne v0, p1, :cond_1
if-nez v2, :cond_0
.line 3
iget-object p1, v0, Lcom/google/common/util/concurrent/Monitor$Guard;->next:Lcom/google/common/util/concurrent/Monitor$Guard;
iput-object p1, p0, Lcom/google/common/util/concurrent/Monitor;->activeGuards:Lcom/google/common/util/concurrent/Monitor$Guard;
goto :goto_1
.line 4
:cond_0
iget-object p1, v0, Lcom/google/common/util/concurrent/Monitor$Guard;->next:Lcom/google/common/util/concurrent/Monitor$Guard;
iput-object p1, v2, Lcom/google/common/util/concurrent/Monitor$Guard;->next:Lcom/google/common/util/concurrent/Monitor$Guard;
.line 5
:goto_1
iput-object v1, v0, Lcom/google/common/util/concurrent/Monitor$Guard;->next:Lcom/google/common/util/concurrent/Monitor$Guard;
goto :goto_2
.line 6
:cond_1
iget-object v2, v0, Lcom/google/common/util/concurrent/Monitor$Guard;->next:Lcom/google/common/util/concurrent/Monitor$Guard;
move-object v3, v2
move-object v2, v0
move-object v0, v3
goto :goto_0
:cond_2
:goto_2
return-void
.end method
.method private static initNanoTime(J)J
.locals 2
const-wide/16 v0, 0x0
cmp-long p0, p0, v0
if-gtz p0, :cond_0
return-wide v0
.line 1
:cond_0
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide p0
cmp-long v0, p0, v0
if-nez v0, :cond_1
const-wide/16 p0, 0x1
:cond_1
return-wide p0
.end method
.method private isSatisfied(Lcom/google/common/util/concurrent/Monitor$Guard;)Z
.locals 0
.annotation build Lcom/google/errorprone/annotations/concurrent/GuardedBy;
value = "lock"
.end annotation
.line 1
:try_start_0
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result p1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
return p1
:catchall_0
move-exception p1
.line 2
invoke-direct {p0}, Lcom/google/common/util/concurrent/Monitor;->signalAllWaiters()V
.line 3
throw p1
.end method
.method private static remainingNanos(JJ)J
.locals 3
const-wide/16 v0, 0x0
cmp-long v2, p2, v0
if-gtz v2, :cond_0
goto :goto_0
.line 1
:cond_0
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v0
sub-long/2addr v0, p0
sub-long v0, p2, v0
:goto_0
return-wide v0
.end method
.method private signalAllWaiters()V
.locals 2
.annotation build Lcom/google/errorprone/annotations/concurrent/GuardedBy;
value = "lock"
.end annotation
.line 1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->activeGuards:Lcom/google/common/util/concurrent/Monitor$Guard;
:goto_0
if-eqz v0, :cond_0
.line 2
iget-object v1, v0, Lcom/google/common/util/concurrent/Monitor$Guard;->condition:Ljava/util/concurrent/locks/Condition;
invoke-interface {v1}, Ljava/util/concurrent/locks/Condition;->signalAll()V
.line 3
iget-object v0, v0, Lcom/google/common/util/concurrent/Monitor$Guard;->next:Lcom/google/common/util/concurrent/Monitor$Guard;
goto :goto_0
:cond_0
return-void
.end method
.method private signalNextWaiter()V
.locals 2
.annotation build Lcom/google/errorprone/annotations/concurrent/GuardedBy;
value = "lock"
.end annotation
.line 1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->activeGuards:Lcom/google/common/util/concurrent/Monitor$Guard;
:goto_0
if-eqz v0, :cond_1
.line 2
invoke-direct {p0, v0}, Lcom/google/common/util/concurrent/Monitor;->isSatisfied(Lcom/google/common/util/concurrent/Monitor$Guard;)Z
move-result v1
if-eqz v1, :cond_0
.line 3
iget-object v0, v0, Lcom/google/common/util/concurrent/Monitor$Guard;->condition:Ljava/util/concurrent/locks/Condition;
invoke-interface {v0}, Ljava/util/concurrent/locks/Condition;->signal()V
goto :goto_1
.line 4
:cond_0
iget-object v0, v0, Lcom/google/common/util/concurrent/Monitor$Guard;->next:Lcom/google/common/util/concurrent/Monitor$Guard;
goto :goto_0
:cond_1
:goto_1
return-void
.end method
.method private static toSafeNanos(JLjava/util/concurrent/TimeUnit;)J
.locals 6
.line 1
invoke-virtual {p2, p0, p1}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
move-result-wide v0
const-wide/16 v2, 0x0
const-wide v4, 0x5ffffffffffffffdL # 2.6815615859885185E154
.line 2
invoke-static/range {v0 .. v5}, Lcom/google/common/primitives/Longs;->constrainToRange(JJJ)J
move-result-wide p0
return-wide p0
.end method
# virtual methods
.method public enter()V
.locals 1
.line 1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->lock()V
return-void
.end method
.method public enter(JLjava/util/concurrent/TimeUnit;)Z
.locals 7
.line 2
invoke-static {p1, p2, p3}, Lcom/google/common/util/concurrent/Monitor;->toSafeNanos(JLjava/util/concurrent/TimeUnit;)J
move-result-wide p1
.line 3
iget-object p3, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
.line 4
iget-boolean v0, p0, Lcom/google/common/util/concurrent/Monitor;->fair:Z
const/4 v1, 0x1
if-nez v0, :cond_0
invoke-virtual {p3}, Ljava/util/concurrent/locks/ReentrantLock;->tryLock()Z
move-result v0
if-eqz v0, :cond_0
return v1
.line 5
:cond_0
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
move-result v0
.line 6
:try_start_0
invoke-static {}, Ljava/lang/System;->nanoTime()J
move-result-wide v2
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_1
move-wide v4, p1
.line 7
:goto_0
:try_start_1
sget-object v6, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {p3, v4, v5, v6}, Ljava/util/concurrent/locks/ReentrantLock;->tryLock(JLjava/util/concurrent/TimeUnit;)Z
move-result p1
:try_end_1
.catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_0
.catchall {:try_start_1 .. :try_end_1} :catchall_1
if-eqz v0, :cond_1
.line 8
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object p2
invoke-virtual {p2}, Ljava/lang/Thread;->interrupt()V
:cond_1
return p1
.line 9
:catch_0
:try_start_2
invoke-static {v2, v3, p1, p2}, Lcom/google/common/util/concurrent/Monitor;->remainingNanos(JJ)J
move-result-wide v4
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
move v0, v1
goto :goto_0
:catchall_0
move-exception p1
goto :goto_1
:catchall_1
move-exception p1
move v1, v0
:goto_1
if-eqz v1, :cond_2
.line 10
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object p2
invoke-virtual {p2}, Ljava/lang/Thread;->interrupt()V
.line 11
:cond_2
throw p1
.end method
.method public enterIf(Lcom/google/common/util/concurrent/Monitor$Guard;)Z
.locals 1
.line 1
iget-object v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
if-ne v0, p0, :cond_1
.line 2
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
.line 3
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->lock()V
.line 4
:try_start_0
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result p1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-nez p1, :cond_0
.line 5
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
:cond_0
return p1
:catchall_0
move-exception p1
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
.line 6
throw p1
.line 7
:cond_1
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public enterIf(Lcom/google/common/util/concurrent/Monitor$Guard;JLjava/util/concurrent/TimeUnit;)Z
.locals 1
.line 8
iget-object v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
if-ne v0, p0, :cond_2
.line 9
invoke-virtual {p0, p2, p3, p4}, Lcom/google/common/util/concurrent/Monitor;->enter(JLjava/util/concurrent/TimeUnit;)Z
move-result p2
if-nez p2, :cond_0
const/4 p1, 0x0
return p1
.line 10
:cond_0
:try_start_0
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result p1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-nez p1, :cond_1
.line 11
iget-object p2, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {p2}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
:cond_1
return p1
:catchall_0
move-exception p1
iget-object p2, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {p2}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
.line 12
throw p1
.line 13
:cond_2
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public enterIfInterruptibly(Lcom/google/common/util/concurrent/Monitor$Guard;)Z
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;
}
.end annotation
.line 1
iget-object v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
if-ne v0, p0, :cond_1
.line 2
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
.line 3
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->lockInterruptibly()V
.line 4
:try_start_0
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result p1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-nez p1, :cond_0
.line 5
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
:cond_0
return p1
:catchall_0
move-exception p1
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
.line 6
throw p1
.line 7
:cond_1
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public enterIfInterruptibly(Lcom/google/common/util/concurrent/Monitor$Guard;JLjava/util/concurrent/TimeUnit;)Z
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;
}
.end annotation
.line 8
iget-object v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
if-ne v0, p0, :cond_2
.line 9
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
.line 10
invoke-virtual {v0, p2, p3, p4}, Ljava/util/concurrent/locks/ReentrantLock;->tryLock(JLjava/util/concurrent/TimeUnit;)Z
move-result p2
if-nez p2, :cond_0
const/4 p1, 0x0
return p1
.line 11
:cond_0
:try_start_0
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result p1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-nez p1, :cond_1
.line 12
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
:cond_1
return p1
:catchall_0
move-exception p1
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
.line 13
throw p1
.line 14
:cond_2
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public enterInterruptibly()V
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;
}
.end annotation
.line 1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->lockInterruptibly()V
return-void
.end method
.method public enterInterruptibly(JLjava/util/concurrent/TimeUnit;)Z
.locals 1
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;
}
.end annotation
.line 2
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0, p1, p2, p3}, Ljava/util/concurrent/locks/ReentrantLock;->tryLock(JLjava/util/concurrent/TimeUnit;)Z
move-result p1
return p1
.end method
.method public enterWhen(Lcom/google/common/util/concurrent/Monitor$Guard;)V
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;
}
.end annotation
.line 1
iget-object v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
if-ne v0, p0, :cond_1
.line 2
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
.line 3
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->isHeldByCurrentThread()Z
move-result v1
.line 4
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->lockInterruptibly()V
.line 5
:try_start_0
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result v0
if-nez v0, :cond_0
.line 6
invoke-direct {p0, p1, v1}, Lcom/google/common/util/concurrent/Monitor;->await(Lcom/google/common/util/concurrent/Monitor$Guard;Z)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:cond_0
return-void
:catchall_0
move-exception p1
.line 7
invoke-virtual {p0}, Lcom/google/common/util/concurrent/Monitor;->leave()V
.line 8
throw p1
.line 9
:cond_1
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public enterWhen(Lcom/google/common/util/concurrent/Monitor$Guard;JLjava/util/concurrent/TimeUnit;)Z
.locals 10
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;
}
.end annotation
.line 10
invoke-static {p2, p3, p4}, Lcom/google/common/util/concurrent/Monitor;->toSafeNanos(JLjava/util/concurrent/TimeUnit;)J
move-result-wide v0
.line 11
iget-object v2, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
if-ne v2, p0, :cond_8
.line 12
iget-object v2, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
.line 13
invoke-virtual {v2}, Ljava/util/concurrent/locks/ReentrantLock;->isHeldByCurrentThread()Z
move-result v3
.line 14
iget-boolean v4, p0, Lcom/google/common/util/concurrent/Monitor;->fair:Z
const/4 v5, 0x0
const-wide/16 v6, 0x0
if-nez v4, :cond_1
.line 15
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
move-result v4
if-nez v4, :cond_0
.line 16
invoke-virtual {v2}, Ljava/util/concurrent/locks/ReentrantLock;->tryLock()Z
move-result v4
if-eqz v4, :cond_1
move-wide v8, v6
goto :goto_0
.line 17
:cond_0
new-instance p1, Ljava/lang/InterruptedException;
invoke-direct {p1}, Ljava/lang/InterruptedException;-><init>()V
throw p1
.line 18
:cond_1
invoke-static {v0, v1}, Lcom/google/common/util/concurrent/Monitor;->initNanoTime(J)J
move-result-wide v8
.line 19
invoke-virtual {v2, p2, p3, p4}, Ljava/util/concurrent/locks/ReentrantLock;->tryLock(JLjava/util/concurrent/TimeUnit;)Z
move-result p2
if-nez p2, :cond_2
return v5
.line 20
:cond_2
:goto_0
:try_start_0
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result p2
if-nez p2, :cond_4
cmp-long p2, v8, v6
if-nez p2, :cond_3
goto :goto_1
.line 21
:cond_3
invoke-static {v8, v9, v0, v1}, Lcom/google/common/util/concurrent/Monitor;->remainingNanos(JJ)J
move-result-wide v0
.line 22
:goto_1
invoke-direct {p0, p1, v0, v1, v3}, Lcom/google/common/util/concurrent/Monitor;->awaitNanos(Lcom/google/common/util/concurrent/Monitor$Guard;JZ)Z
move-result p1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz p1, :cond_5
:cond_4
const/4 v5, 0x1
:cond_5
if-nez v5, :cond_6
.line 23
invoke-virtual {v2}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
:cond_6
return v5
:catchall_0
move-exception p1
if-nez v3, :cond_7
.line 24
:try_start_1
invoke-direct {p0}, Lcom/google/common/util/concurrent/Monitor;->signalNextWaiter()V
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
goto :goto_2
:catchall_1
move-exception p1
.line 25
invoke-virtual {v2}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
.line 26
throw p1
.line 27
:cond_7
:goto_2
invoke-virtual {v2}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
.line 28
throw p1
.line 29
:cond_8
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public enterWhenUninterruptibly(Lcom/google/common/util/concurrent/Monitor$Guard;)V
.locals 2
.line 1
iget-object v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
if-ne v0, p0, :cond_1
.line 2
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
.line 3
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->isHeldByCurrentThread()Z
move-result v1
.line 4
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->lock()V
.line 5
:try_start_0
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result v0
if-nez v0, :cond_0
.line 6
invoke-direct {p0, p1, v1}, Lcom/google/common/util/concurrent/Monitor;->awaitUninterruptibly(Lcom/google/common/util/concurrent/Monitor$Guard;Z)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:cond_0
return-void
:catchall_0
move-exception p1
.line 7
invoke-virtual {p0}, Lcom/google/common/util/concurrent/Monitor;->leave()V
.line 8
throw p1
.line 9
:cond_1
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public enterWhenUninterruptibly(Lcom/google/common/util/concurrent/Monitor$Guard;JLjava/util/concurrent/TimeUnit;)Z
.locals 11
.line 10
invoke-static {p2, p3, p4}, Lcom/google/common/util/concurrent/Monitor;->toSafeNanos(JLjava/util/concurrent/TimeUnit;)J
move-result-wide p2
.line 11
iget-object p4, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
if-ne p4, p0, :cond_9
.line 12
iget-object p4, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
.line 13
invoke-virtual {p4}, Ljava/util/concurrent/locks/ReentrantLock;->isHeldByCurrentThread()Z
move-result v0
.line 14
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
move-result v1
const/4 v2, 0x1
.line 15
:try_start_0
iget-boolean v3, p0, Lcom/google/common/util/concurrent/Monitor;->fair:Z
const/4 v4, 0x0
const-wide/16 v5, 0x0
if-nez v3, :cond_1
invoke-virtual {p4}, Ljava/util/concurrent/locks/ReentrantLock;->tryLock()Z
move-result v3
if-nez v3, :cond_0
goto :goto_0
:cond_0
move-wide v7, v5
goto :goto_2
.line 16
:cond_1
:goto_0
invoke-static {p2, p3}, Lcom/google/common/util/concurrent/Monitor;->initNanoTime(J)J
move-result-wide v7
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_2
move-wide v9, p2
.line 17
:goto_1
:try_start_1
sget-object v3, Ljava/util/concurrent/TimeUnit;->NANOSECONDS:Ljava/util/concurrent/TimeUnit;
invoke-virtual {p4, v9, v10, v3}, Ljava/util/concurrent/locks/ReentrantLock;->tryLock(JLjava/util/concurrent/TimeUnit;)Z
move-result v3
:try_end_1
.catch Ljava/lang/InterruptedException; {:try_start_1 .. :try_end_1} :catch_1
.catchall {:try_start_1 .. :try_end_1} :catchall_2
if-eqz v3, :cond_6
.line 18
:goto_2
:try_start_2
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result v3
if-eqz v3, :cond_2
goto :goto_4
:cond_2
cmp-long v3, v7, v5
if-nez v3, :cond_3
.line 19
invoke-static {p2, p3}, Lcom/google/common/util/concurrent/Monitor;->initNanoTime(J)J
move-result-wide v7
move-wide v9, p2
goto :goto_3
.line 20
:cond_3
invoke-static {v7, v8, p2, p3}, Lcom/google/common/util/concurrent/Monitor;->remainingNanos(JJ)J
move-result-wide v9
.line 21
:goto_3
invoke-direct {p0, p1, v9, v10, v0}, Lcom/google/common/util/concurrent/Monitor;->awaitNanos(Lcom/google/common/util/concurrent/Monitor$Guard;JZ)Z
move-result v2
:try_end_2
.catch Ljava/lang/InterruptedException; {:try_start_2 .. :try_end_2} :catch_0
.catchall {:try_start_2 .. :try_end_2} :catchall_0
:goto_4
if-nez v2, :cond_4
.line 22
:try_start_3
invoke-virtual {p4}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
:try_end_3
.catchall {:try_start_3 .. :try_end_3} :catchall_2
:cond_4
if-eqz v1, :cond_5
.line 23
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object p1
invoke-virtual {p1}, Ljava/lang/Thread;->interrupt()V
:cond_5
return v2
:catchall_0
move-exception p1
.line 24
:try_start_4
invoke-virtual {p4}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
.line 25
throw p1
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_2
:catch_0
move v1, v2
move v0, v4
goto :goto_2
:cond_6
if-eqz v1, :cond_7
.line 26
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object p1
invoke-virtual {p1}, Ljava/lang/Thread;->interrupt()V
:cond_7
return v4
.line 27
:catch_1
:try_start_5
invoke-static {v7, v8, p2, p3}, Lcom/google/common/util/concurrent/Monitor;->remainingNanos(JJ)J
move-result-wide v9
:try_end_5
.catchall {:try_start_5 .. :try_end_5} :catchall_1
move v1, v2
goto :goto_1
:catchall_1
move-exception p1
move v1, v2
goto :goto_5
:catchall_2
move-exception p1
:goto_5
if-eqz v1, :cond_8
.line 28
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object p2
invoke-virtual {p2}, Ljava/lang/Thread;->interrupt()V
.line 29
:cond_8
throw p1
.line 30
:cond_9
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public getOccupiedDepth()I
.locals 1
.line 1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->getHoldCount()I
move-result v0
return v0
.end method
.method public getQueueLength()I
.locals 1
.line 1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->getQueueLength()I
move-result v0
return v0
.end method
.method public getWaitQueueLength(Lcom/google/common/util/concurrent/Monitor$Guard;)I
.locals 1
.line 1
iget-object v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
if-ne v0, p0, :cond_0
.line 2
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->lock()V
.line 3
:try_start_0
iget p1, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->waiterCount:I
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 4
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
return p1
:catchall_0
move-exception p1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
.line 5
throw p1
.line 6
:cond_0
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public hasQueuedThread(Ljava/lang/Thread;)Z
.locals 1
.line 1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0, p1}, Ljava/util/concurrent/locks/ReentrantLock;->hasQueuedThread(Ljava/lang/Thread;)Z
move-result p1
return p1
.end method
.method public hasQueuedThreads()Z
.locals 1
.line 1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->hasQueuedThreads()Z
move-result v0
return v0
.end method
.method public hasWaiters(Lcom/google/common/util/concurrent/Monitor$Guard;)Z
.locals 0
.line 1
invoke-virtual {p0, p1}, Lcom/google/common/util/concurrent/Monitor;->getWaitQueueLength(Lcom/google/common/util/concurrent/Monitor$Guard;)I
move-result p1
if-lez p1, :cond_0
const/4 p1, 0x1
goto :goto_0
:cond_0
const/4 p1, 0x0
:goto_0
return p1
.end method
.method public isFair()Z
.locals 1
.line 1
iget-boolean v0, p0, Lcom/google/common/util/concurrent/Monitor;->fair:Z
return v0
.end method
.method public isOccupied()Z
.locals 1
.line 1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->isLocked()Z
move-result v0
return v0
.end method
.method public isOccupiedByCurrentThread()Z
.locals 1
.line 1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->isHeldByCurrentThread()Z
move-result v0
return v0
.end method
.method public leave()V
.locals 3
.line 1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
.line 2
:try_start_0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->getHoldCount()I
move-result v1
const/4 v2, 0x1
if-ne v1, v2, :cond_0
.line 3
invoke-direct {p0}, Lcom/google/common/util/concurrent/Monitor;->signalNextWaiter()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 4
:cond_0
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
return-void
:catchall_0
move-exception v1
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
.line 5
throw v1
.end method
.method public tryEnter()Z
.locals 1
.line 1
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->tryLock()Z
move-result v0
return v0
.end method
.method public tryEnterIf(Lcom/google/common/util/concurrent/Monitor$Guard;)Z
.locals 2
.line 1
iget-object v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
if-ne v0, p0, :cond_2
.line 2
iget-object v0, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
.line 3
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->tryLock()Z
move-result v1
if-nez v1, :cond_0
const/4 p1, 0x0
return p1
.line 4
:cond_0
:try_start_0
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result p1
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-nez p1, :cond_1
.line 5
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
:cond_1
return p1
:catchall_0
move-exception p1
invoke-virtual {v0}, Ljava/util/concurrent/locks/ReentrantLock;->unlock()V
.line 6
throw p1
.line 7
:cond_2
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public waitFor(Lcom/google/common/util/concurrent/Monitor$Guard;)V
.locals 3
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;
}
.end annotation
.line 1
iget-object v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
const/4 v1, 0x1
if-ne v0, p0, :cond_0
move v0, v1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
iget-object v2, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v2}, Ljava/util/concurrent/locks/ReentrantLock;->isHeldByCurrentThread()Z
move-result v2
and-int/2addr v0, v2
if-eqz v0, :cond_2
.line 2
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result v0
if-nez v0, :cond_1
.line 3
invoke-direct {p0, p1, v1}, Lcom/google/common/util/concurrent/Monitor;->await(Lcom/google/common/util/concurrent/Monitor$Guard;Z)V
:cond_1
return-void
.line 4
:cond_2
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public waitFor(Lcom/google/common/util/concurrent/Monitor$Guard;JLjava/util/concurrent/TimeUnit;)Z
.locals 2
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/lang/InterruptedException;
}
.end annotation
.line 5
invoke-static {p2, p3, p4}, Lcom/google/common/util/concurrent/Monitor;->toSafeNanos(JLjava/util/concurrent/TimeUnit;)J
move-result-wide p2
.line 6
iget-object p4, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
const/4 v0, 0x1
if-ne p4, p0, :cond_0
move p4, v0
goto :goto_0
:cond_0
const/4 p4, 0x0
:goto_0
iget-object v1, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v1}, Ljava/util/concurrent/locks/ReentrantLock;->isHeldByCurrentThread()Z
move-result v1
and-int/2addr p4, v1
if-eqz p4, :cond_3
.line 7
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result p4
if-eqz p4, :cond_1
return v0
.line 8
:cond_1
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
move-result p4
if-nez p4, :cond_2
.line 9
invoke-direct {p0, p1, p2, p3, v0}, Lcom/google/common/util/concurrent/Monitor;->awaitNanos(Lcom/google/common/util/concurrent/Monitor$Guard;JZ)Z
move-result p1
return p1
.line 10
:cond_2
new-instance p1, Ljava/lang/InterruptedException;
invoke-direct {p1}, Ljava/lang/InterruptedException;-><init>()V
throw p1
.line 11
:cond_3
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public waitForUninterruptibly(Lcom/google/common/util/concurrent/Monitor$Guard;)V
.locals 3
.line 1
iget-object v0, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
const/4 v1, 0x1
if-ne v0, p0, :cond_0
move v0, v1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
iget-object v2, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v2}, Ljava/util/concurrent/locks/ReentrantLock;->isHeldByCurrentThread()Z
move-result v2
and-int/2addr v0, v2
if-eqz v0, :cond_2
.line 2
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result v0
if-nez v0, :cond_1
.line 3
invoke-direct {p0, p1, v1}, Lcom/google/common/util/concurrent/Monitor;->awaitUninterruptibly(Lcom/google/common/util/concurrent/Monitor$Guard;Z)V
:cond_1
return-void
.line 4
:cond_2
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method
.method public waitForUninterruptibly(Lcom/google/common/util/concurrent/Monitor$Guard;JLjava/util/concurrent/TimeUnit;)Z
.locals 7
.line 5
invoke-static {p2, p3, p4}, Lcom/google/common/util/concurrent/Monitor;->toSafeNanos(JLjava/util/concurrent/TimeUnit;)J
move-result-wide p2
.line 6
iget-object p4, p1, Lcom/google/common/util/concurrent/Monitor$Guard;->monitor:Lcom/google/common/util/concurrent/Monitor;
const/4 v0, 0x0
const/4 v1, 0x1
if-ne p4, p0, :cond_0
move p4, v1
goto :goto_0
:cond_0
move p4, v0
:goto_0
iget-object v2, p0, Lcom/google/common/util/concurrent/Monitor;->lock:Ljava/util/concurrent/locks/ReentrantLock;
invoke-virtual {v2}, Ljava/util/concurrent/locks/ReentrantLock;->isHeldByCurrentThread()Z
move-result v2
and-int/2addr p4, v2
if-eqz p4, :cond_5
.line 7
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result p4
if-eqz p4, :cond_1
return v1
.line 8
:cond_1
invoke-static {p2, p3}, Lcom/google/common/util/concurrent/Monitor;->initNanoTime(J)J
move-result-wide v2
.line 9
invoke-static {}, Ljava/lang/Thread;->interrupted()Z
move-result p4
move-wide v4, p2
move v6, v1
.line 10
:goto_1
:try_start_0
invoke-direct {p0, p1, v4, v5, v6}, Lcom/google/common/util/concurrent/Monitor;->awaitNanos(Lcom/google/common/util/concurrent/Monitor$Guard;JZ)Z
move-result p1
:try_end_0
.catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
if-eqz p4, :cond_2
.line 11
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object p2
invoke-virtual {p2}, Ljava/lang/Thread;->interrupt()V
:cond_2
return p1
:catchall_0
move-exception p1
move v1, p4
goto :goto_2
.line 12
:catch_0
:try_start_1
invoke-virtual {p1}, Lcom/google/common/util/concurrent/Monitor$Guard;->isSatisfied()Z
move-result p4
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
if-eqz p4, :cond_3
.line 13
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object p1
invoke-virtual {p1}, Ljava/lang/Thread;->interrupt()V
return v1
.line 14
:cond_3
:try_start_2
invoke-static {v2, v3, p2, p3}, Lcom/google/common/util/concurrent/Monitor;->remainingNanos(JJ)J
move-result-wide v4
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_1
move v6, v0
move p4, v1
goto :goto_1
:catchall_1
move-exception p1
:goto_2
if-eqz v1, :cond_4
.line 15
invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;
move-result-object p2
invoke-virtual {p2}, Ljava/lang/Thread;->interrupt()V
.line 16
:cond_4
throw p1
.line 17
:cond_5
new-instance p1, Ljava/lang/IllegalMonitorStateException;
invoke-direct {p1}, Ljava/lang/IllegalMonitorStateException;-><init>()V
throw p1
.end method