394 lines
6.4 KiB
Smali
394 lines
6.4 KiB
Smali
.class public final Lrx/internal/util/c;
|
|
.super Ljava/util/concurrent/atomic/AtomicLong;
|
|
.source "BackpressureDrainManager.java"
|
|
|
|
# interfaces
|
|
.implements Lrx/Producer;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lrx/internal/util/c$a;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field private static final serialVersionUID:J = 0x2738d34f11cd4869L
|
|
|
|
|
|
# instance fields
|
|
.field final actual:Lrx/internal/util/c$a;
|
|
|
|
.field emitting:Z
|
|
|
|
.field exception:Ljava/lang/Throwable;
|
|
|
|
.field public volatile terminated:Z
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lrx/internal/util/c$a;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/util/concurrent/atomic/AtomicLong;-><init>()V
|
|
|
|
iput-object p1, p0, Lrx/internal/util/c;->actual:Lrx/internal/util/c$a;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final M(Ljava/lang/Throwable;)V
|
|
.locals 1
|
|
|
|
iget-boolean v0, p0, Lrx/internal/util/c;->terminated:Z
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
iput-object p1, p0, Lrx/internal/util/c;->exception:Ljava/lang/Throwable;
|
|
|
|
const/4 p1, 0x1
|
|
|
|
iput-boolean p1, p0, Lrx/internal/util/c;->terminated:Z
|
|
|
|
invoke-virtual {p0}, Lrx/internal/util/c;->drain()V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method public final drain()V
|
|
.locals 13
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-boolean v0, p0, Lrx/internal/util/c;->emitting:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Lrx/internal/util/c;->emitting:Z
|
|
|
|
iget-boolean v1, p0, Lrx/internal/util/c;->terminated:Z
|
|
|
|
monitor-exit p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_5
|
|
|
|
invoke-virtual {p0}, Lrx/internal/util/c;->get()J
|
|
|
|
move-result-wide v2
|
|
|
|
const/4 v4, 0x0
|
|
|
|
:try_start_1
|
|
iget-object v5, p0, Lrx/internal/util/c;->actual:Lrx/internal/util/c$a;
|
|
|
|
:goto_0
|
|
const/4 v6, 0x0
|
|
|
|
:goto_1
|
|
const-wide/16 v7, 0x0
|
|
|
|
cmp-long v9, v2, v7
|
|
|
|
if-gtz v9, :cond_1
|
|
|
|
if-eqz v1, :cond_5
|
|
|
|
:cond_1
|
|
if-eqz v1, :cond_3
|
|
|
|
invoke-interface {v5}, Lrx/internal/util/c$a;->peek()Ljava/lang/Object;
|
|
|
|
move-result-object v9
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_3
|
|
|
|
if-nez v9, :cond_2
|
|
|
|
:try_start_2
|
|
iget-object v1, p0, Lrx/internal/util/c;->exception:Ljava/lang/Throwable;
|
|
|
|
invoke-interface {v5, v1}, Lrx/internal/util/c$a;->H(Ljava/lang/Throwable;)V
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v1
|
|
|
|
goto :goto_6
|
|
|
|
:cond_2
|
|
cmp-long v9, v2, v7
|
|
|
|
if-eqz v9, :cond_5
|
|
|
|
:cond_3
|
|
:try_start_3
|
|
invoke-interface {v5}, Lrx/internal/util/c$a;->poll()Ljava/lang/Object;
|
|
|
|
move-result-object v9
|
|
|
|
if-eqz v9, :cond_5
|
|
|
|
invoke-interface {v5, v9}, Lrx/internal/util/c$a;->accept(Ljava/lang/Object;)Z
|
|
|
|
move-result v7
|
|
|
|
if-eqz v7, :cond_4
|
|
|
|
return-void
|
|
|
|
:cond_4
|
|
const-wide/16 v7, 0x1
|
|
|
|
sub-long/2addr v2, v7
|
|
|
|
add-int/lit8 v6, v6, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_5
|
|
monitor-enter p0
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_3
|
|
|
|
:try_start_4
|
|
iget-boolean v1, p0, Lrx/internal/util/c;->terminated:Z
|
|
|
|
invoke-interface {v5}, Lrx/internal/util/c$a;->peek()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
if-eqz v2, :cond_6
|
|
|
|
const/4 v2, 0x1
|
|
|
|
goto :goto_2
|
|
|
|
:cond_6
|
|
const/4 v2, 0x0
|
|
|
|
:goto_2
|
|
invoke-virtual {p0}, Lrx/internal/util/c;->get()J
|
|
|
|
move-result-wide v9
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_1
|
|
|
|
const-wide v11, 0x7fffffffffffffffL
|
|
|
|
cmp-long v3, v9, v11
|
|
|
|
if-nez v3, :cond_8
|
|
|
|
if-nez v2, :cond_7
|
|
|
|
if-nez v1, :cond_7
|
|
|
|
:try_start_5
|
|
iput-boolean v4, p0, Lrx/internal/util/c;->emitting:Z
|
|
|
|
monitor-exit p0
|
|
:try_end_5
|
|
.catchall {:try_start_5 .. :try_end_5} :catchall_2
|
|
|
|
return-void
|
|
|
|
:cond_7
|
|
move-wide v2, v11
|
|
|
|
goto :goto_3
|
|
|
|
:cond_8
|
|
neg-int v3, v6
|
|
|
|
int-to-long v9, v3
|
|
|
|
:try_start_6
|
|
invoke-virtual {p0, v9, v10}, Lrx/internal/util/c;->addAndGet(J)J
|
|
|
|
move-result-wide v9
|
|
|
|
cmp-long v3, v9, v7
|
|
|
|
if-eqz v3, :cond_9
|
|
|
|
if-nez v2, :cond_a
|
|
|
|
:cond_9
|
|
if-eqz v1, :cond_b
|
|
|
|
if-eqz v2, :cond_a
|
|
|
|
goto :goto_4
|
|
|
|
:cond_a
|
|
move-wide v2, v9
|
|
|
|
:goto_3
|
|
monitor-exit p0
|
|
:try_end_6
|
|
.catchall {:try_start_6 .. :try_end_6} :catchall_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_b
|
|
:goto_4
|
|
:try_start_7
|
|
iput-boolean v4, p0, Lrx/internal/util/c;->emitting:Z
|
|
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:catchall_1
|
|
move-exception v1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_5
|
|
monitor-exit p0
|
|
:try_end_7
|
|
.catchall {:try_start_7 .. :try_end_7} :catchall_2
|
|
|
|
:try_start_8
|
|
throw v1
|
|
:try_end_8
|
|
.catchall {:try_start_8 .. :try_end_8} :catchall_0
|
|
|
|
:catchall_2
|
|
move-exception v1
|
|
|
|
goto :goto_5
|
|
|
|
:catchall_3
|
|
move-exception v1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
:goto_6
|
|
if-nez v0, :cond_c
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_9
|
|
iput-boolean v4, p0, Lrx/internal/util/c;->emitting:Z
|
|
|
|
monitor-exit p0
|
|
|
|
goto :goto_7
|
|
|
|
:catchall_4
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
:try_end_9
|
|
.catchall {:try_start_9 .. :try_end_9} :catchall_4
|
|
|
|
throw v0
|
|
|
|
:cond_c
|
|
:goto_7
|
|
throw v1
|
|
|
|
:catchall_5
|
|
move-exception v0
|
|
|
|
:try_start_a
|
|
monitor-exit p0
|
|
:try_end_a
|
|
.catchall {:try_start_a .. :try_end_a} :catchall_5
|
|
|
|
throw v0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final request(J)V
|
|
.locals 10
|
|
|
|
const-wide/16 v0, 0x0
|
|
|
|
cmp-long v2, p1, v0
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-virtual {p0}, Lrx/internal/util/c;->get()J
|
|
|
|
move-result-wide v2
|
|
|
|
const/4 v4, 0x1
|
|
|
|
cmp-long v5, v2, v0
|
|
|
|
if-nez v5, :cond_1
|
|
|
|
const/4 v5, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 v5, 0x0
|
|
|
|
:goto_0
|
|
const-wide v6, 0x7fffffffffffffffL
|
|
|
|
cmp-long v8, v2, v6
|
|
|
|
if-eqz v8, :cond_4
|
|
|
|
cmp-long v8, p1, v6
|
|
|
|
if-nez v8, :cond_2
|
|
|
|
move-wide v6, p1
|
|
|
|
const/4 v5, 0x1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
sub-long v8, v6, p1
|
|
|
|
cmp-long v4, v2, v8
|
|
|
|
if-lez v4, :cond_3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_3
|
|
add-long v6, v2, p1
|
|
|
|
:goto_1
|
|
invoke-virtual {p0, v2, v3, v6, v7}, Lrx/internal/util/c;->compareAndSet(JJ)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
:cond_4
|
|
if-eqz v5, :cond_5
|
|
|
|
invoke-virtual {p0}, Lrx/internal/util/c;->drain()V
|
|
|
|
:cond_5
|
|
return-void
|
|
.end method
|