r.smali

.class public final Lfb/r;
.super Lbb/h0;
.source "SourceFile"

# interfaces
.implements Lbb/w0;


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lfb/r$a;
    }
.end annotation

.annotation runtime Lkotlin/Metadata;
.end annotation


# static fields
.field private static final h:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;
    .annotation build Lorg/jetbrains/annotations/NotNull;
    .end annotation
.end field


# instance fields
.field private final c:Lbb/h0;
    .annotation build Lorg/jetbrains/annotations/NotNull;
    .end annotation
.end field

.field private final d:I

.field private final synthetic e:Lbb/w0;

.field private final f:Lfb/w;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Lfb/w<",
            "Ljava/lang/Runnable;",
            ">;"
        }
    .end annotation

    .annotation build Lorg/jetbrains/annotations/NotNull;
    .end annotation
.end field

.field private final g:Ljava/lang/Object;
    .annotation build Lorg/jetbrains/annotations/NotNull;
    .end annotation
.end field

.field private volatile runningWorkers:I


# direct methods
.method static constructor <clinit>()V
    .registers 2

    const-class v0, Lfb/r;

    const-string v1, "runningWorkers"

    invoke-static {v0, v1}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;

    move-result-object v0

    sput-object v0, Lfb/r;->h:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;

    return-void
.end method

.method public constructor <init>(Lbb/h0;I)V
    .registers 3
    .param p1    # Lbb/h0;
        .annotation build Lorg/jetbrains/annotations/NotNull;
        .end annotation
    .end param

    invoke-direct {p0}, Lbb/h0;-><init>()V

    iput-object p1, p0, Lfb/r;->c:Lbb/h0;

    iput p2, p0, Lfb/r;->d:I

    instance-of p2, p1, Lbb/w0;

    if-eqz p2, :cond_e

    check-cast p1, Lbb/w0;

    goto :goto_f

    :cond_e
    const/4 p1, 0x0

    :goto_f
    if-nez p1, :cond_15

    invoke-static {}, Lbb/t0;->a()Lbb/w0;

    move-result-object p1

    :cond_15
    iput-object p1, p0, Lfb/r;->e:Lbb/w0;

    new-instance p1, Lfb/w;

    const/4 p2, 0x0

    invoke-direct {p1, p2}, Lfb/w;-><init>(Z)V

    iput-object p1, p0, Lfb/r;->f:Lfb/w;

    new-instance p1, Ljava/lang/Object;

    invoke-direct {p1}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Lfb/r;->g:Ljava/lang/Object;

    return-void
.end method

.method public static final synthetic L(Lfb/r;)Lbb/h0;
    .registers 1

    iget-object p0, p0, Lfb/r;->c:Lbb/h0;

    return-object p0
.end method

.method public static final synthetic M(Lfb/r;)Ljava/lang/Runnable;
    .registers 1

    invoke-direct {p0}, Lfb/r;->O()Ljava/lang/Runnable;

    move-result-object p0

    return-object p0
.end method

.method private final O()Ljava/lang/Runnable;
    .registers 4

    :goto_0
    iget-object v0, p0, Lfb/r;->f:Lfb/w;

    invoke-virtual {v0}, Lfb/w;->d()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Runnable;

    if-nez v0, :cond_25

    iget-object v0, p0, Lfb/r;->g:Ljava/lang/Object;

    monitor-enter v0

    :try_start_d
    sget-object v1, Lfb/r;->h:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;

    invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->decrementAndGet(Ljava/lang/Object;)I

    iget-object v2, p0, Lfb/r;->f:Lfb/w;

    invoke-virtual {v2}, Lfb/w;->c()I

    move-result v2
    :try_end_18
    .catchall {:try_start_d .. :try_end_18} :catchall_22

    if-nez v2, :cond_1d

    monitor-exit v0

    const/4 v0, 0x0

    return-object v0

    :cond_1d
    :try_start_1d
    invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->incrementAndGet(Ljava/lang/Object;)I
    :try_end_20
    .catchall {:try_start_1d .. :try_end_20} :catchall_22

    monitor-exit v0

    goto :goto_0

    :catchall_22
    move-exception v1

    monitor-exit v0

    throw v1

    :cond_25
    return-object v0
.end method

.method private final P()Z
    .registers 5

    iget-object v0, p0, Lfb/r;->g:Ljava/lang/Object;

    monitor-enter v0

    :try_start_3
    sget-object v1, Lfb/r;->h:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;

    invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->get(Ljava/lang/Object;)I

    move-result v2

    iget v3, p0, Lfb/r;->d:I
    :try_end_b
    .catchall {:try_start_3 .. :try_end_b} :catchall_16

    if-lt v2, v3, :cond_10

    monitor-exit v0

    const/4 v0, 0x0

    return v0

    :cond_10
    :try_start_10
    invoke-virtual {v1, p0}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->incrementAndGet(Ljava/lang/Object;)I
    :try_end_13
    .catchall {:try_start_10 .. :try_end_13} :catchall_16

    monitor-exit v0

    const/4 v0, 0x1

    return v0

    :catchall_16
    move-exception v1

    monitor-exit v0

    throw v1
.end method


# virtual methods
.method public a(Lkotlin/coroutines/CoroutineContext;Ljava/lang/Runnable;)V
    .registers 3
    .param p1    # Lkotlin/coroutines/CoroutineContext;
        .annotation build Lorg/jetbrains/annotations/NotNull;
        .end annotation
    .end param
    .param p2    # Ljava/lang/Runnable;
        .annotation build Lorg/jetbrains/annotations/NotNull;
        .end annotation
    .end param

    iget-object p1, p0, Lfb/r;->f:Lfb/w;

    invoke-virtual {p1, p2}, Lfb/w;->a(Ljava/lang/Object;)Z

    sget-object p1, Lfb/r;->h:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;

    invoke-virtual {p1, p0}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->get(Ljava/lang/Object;)I

    move-result p1

    iget p2, p0, Lfb/r;->d:I

    if-ge p1, p2, :cond_26

    invoke-direct {p0}, Lfb/r;->P()Z

    move-result p1

    if-eqz p1, :cond_26

    invoke-direct {p0}, Lfb/r;->O()Ljava/lang/Runnable;

    move-result-object p1

    if-nez p1, :cond_1c

    goto :goto_26

    :cond_1c
    new-instance p2, Lfb/r$a;

    invoke-direct {p2, p0, p1}, Lfb/r$a;-><init>(Lfb/r;Ljava/lang/Runnable;)V

    iget-object p1, p0, Lfb/r;->c:Lbb/h0;

    invoke-virtual {p1, p0, p2}, Lbb/h0;->a(Lkotlin/coroutines/CoroutineContext;Ljava/lang/Runnable;)V

    :cond_26
    :goto_26
    return-void
.end method