.class public final Lj6/c4;
.super Ljava/lang/Thread;
.source ""


# instance fields
.field public final r:Ljava/lang/Object;

.field public final s:Ljava/util/concurrent/BlockingQueue;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/BlockingQueue<",
            "Lj6/b4<",
            "*>;>;"
        }
    .end annotation
.end field

.field public t:Z

.field public final synthetic u:Lj6/d4;


# direct methods
.method public constructor <init>(Lj6/d4;Ljava/lang/String;Ljava/util/concurrent/BlockingQueue;)V
    .registers 4
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/util/concurrent/BlockingQueue<",
            "Lj6/b4<",
            "*>;>;)V"
        }
    .end annotation

    iput-object p1, p0, Lj6/c4;->u:Lj6/d4;

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

    const/4 p1, 0x0

    iput-boolean p1, p0, Lj6/c4;->t:Z

    const-string p1, "null reference"

    .line 1
    invoke-static {p3, p1}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;

    .line 2
    new-instance p1, Ljava/lang/Object;

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

    iput-object p1, p0, Lj6/c4;->r:Ljava/lang/Object;

    iput-object p3, p0, Lj6/c4;->s:Ljava/util/concurrent/BlockingQueue;

    invoke-virtual {p0, p2}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V

    return-void
.end method


# virtual methods
.method public final a()V
    .registers 5

    iget-object v0, p0, Lj6/c4;->u:Lj6/d4;

    .line 1
    iget-object v0, v0, Lj6/d4;->i:Ljava/lang/Object;

    .line 2
    monitor-enter v0

    :try_start_5
    iget-boolean v1, p0, Lj6/c4;->t:Z

    if-nez v1, :cond_38

    iget-object v1, p0, Lj6/c4;->u:Lj6/d4;

    .line 3
    iget-object v1, v1, Lj6/d4;->j:Ljava/util/concurrent/Semaphore;

    .line 4
    invoke-virtual {v1}, Ljava/util/concurrent/Semaphore;->release()V

    iget-object v1, p0, Lj6/c4;->u:Lj6/d4;

    .line 5
    iget-object v1, v1, Lj6/d4;->i:Ljava/lang/Object;

    .line 6
    invoke-virtual {v1}, Ljava/lang/Object;->notifyAll()V

    iget-object v1, p0, Lj6/c4;->u:Lj6/d4;

    .line 7
    iget-object v2, v1, Lj6/d4;->c:Lj6/c4;

    const/4 v3, 0x0

    if-ne p0, v2, :cond_21

    .line 8
    iput-object v3, v1, Lj6/d4;->c:Lj6/c4;

    goto :goto_35

    .line 9
    :cond_21
    iget-object v2, v1, Lj6/d4;->d:Lj6/c4;

    if-ne p0, v2, :cond_28

    .line 10
    iput-object v3, v1, Lj6/d4;->d:Lj6/c4;

    goto :goto_35

    .line 11
    :cond_28
    iget-object v1, v1, Lcom/google/android/gms/measurement/internal/e;->a:Lcom/google/android/gms/measurement/internal/d;

    invoke-virtual {v1}, Lcom/google/android/gms/measurement/internal/d;->s()Lcom/google/android/gms/measurement/internal/b;

    move-result-object v1

    .line 12
    iget-object v1, v1, Lcom/google/android/gms/measurement/internal/b;->f:Lj6/e3;

    const-string v2, "Current scheduler thread is neither worker nor network"

    .line 13
    invoke-virtual {v1, v2}, Lj6/e3;->c(Ljava/lang/String;)V

    :goto_35
    const/4 v1, 0x1

    iput-boolean v1, p0, Lj6/c4;->t:Z

    :cond_38
    monitor-exit v0

    return-void

    :catchall_3a
    move-exception v1

    monitor-exit v0
    :try_end_3c
    .catchall {:try_start_5 .. :try_end_3c} :catchall_3a

    throw v1
.end method

.method public final b(Ljava/lang/InterruptedException;)V
    .registers 5

    iget-object v0, p0, Lj6/c4;->u:Lj6/d4;

    iget-object v0, v0, Lcom/google/android/gms/measurement/internal/e;->a:Lcom/google/android/gms/measurement/internal/d;

    invoke-virtual {v0}, Lcom/google/android/gms/measurement/internal/d;->s()Lcom/google/android/gms/measurement/internal/b;

    move-result-object v0

    .line 1
    iget-object v0, v0, Lcom/google/android/gms/measurement/internal/b;->i:Lj6/e3;

    .line 2
    invoke-virtual {p0}, Ljava/lang/Thread;->getName()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    const-string v2, " was interrupted"

    invoke-virtual {v1, v2}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1, p1}, Lj6/e3;->d(Ljava/lang/String;Ljava/lang/Object;)V

    return-void
.end method

.method public final run()V
    .registers 7

    const/4 v0, 0x1

    const/4 v1, 0x0

    :goto_2
    if-nez v1, :cond_12

    :try_start_4
    iget-object v2, p0, Lj6/c4;->u:Lj6/d4;

    .line 1
    iget-object v2, v2, Lj6/d4;->j:Ljava/util/concurrent/Semaphore;

    .line 2
    invoke-virtual {v2}, Ljava/util/concurrent/Semaphore;->acquire()V
    :try_end_b
    .catch Ljava/lang/InterruptedException; {:try_start_4 .. :try_end_b} :catch_d

    move v1, v0

    goto :goto_2

    :catch_d
    move-exception v2

    invoke-virtual {p0, v2}, Lj6/c4;->b(Ljava/lang/InterruptedException;)V

    goto :goto_2

    :cond_12
    :try_start_12
    invoke-static {}, Landroid/os/Process;->myTid()I

    move-result v1

    invoke-static {v1}, Landroid/os/Process;->getThreadPriority(I)I

    move-result v1

    :goto_1a
    iget-object v2, p0, Lj6/c4;->s:Ljava/util/concurrent/BlockingQueue;

    invoke-interface {v2}, Ljava/util/concurrent/BlockingQueue;->poll()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Lj6/b4;

    if-eqz v2, :cond_33

    iget-boolean v3, v2, Lj6/b4;->s:Z

    if-eq v0, v3, :cond_2b

    const/16 v3, 0xa

    goto :goto_2c

    :cond_2b
    move v3, v1

    :goto_2c
    invoke-static {v3}, Landroid/os/Process;->setThreadPriority(I)V

    invoke-virtual {v2}, Ljava/util/concurrent/FutureTask;->run()V

    goto :goto_1a

    :cond_33
    iget-object v2, p0, Lj6/c4;->r:Ljava/lang/Object;

    monitor-enter v2
    :try_end_36
    .catchall {:try_start_12 .. :try_end_36} :catchall_7c

    :try_start_36
    iget-object v3, p0, Lj6/c4;->s:Ljava/util/concurrent/BlockingQueue;

    invoke-interface {v3}, Ljava/util/concurrent/BlockingQueue;->peek()Ljava/lang/Object;

    move-result-object v3

    if-nez v3, :cond_4f

    iget-object v3, p0, Lj6/c4;->u:Lj6/d4;

    .line 3
    invoke-static {v3}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_43
    .catchall {:try_start_36 .. :try_end_43} :catchall_79

    .line 4
    :try_start_43
    iget-object v3, p0, Lj6/c4;->r:Ljava/lang/Object;

    const-wide/16 v4, 0x7530

    invoke-virtual {v3, v4, v5}, Ljava/lang/Object;->wait(J)V
    :try_end_4a
    .catch Ljava/lang/InterruptedException; {:try_start_43 .. :try_end_4a} :catch_4b
    .catchall {:try_start_43 .. :try_end_4a} :catchall_79

    goto :goto_4f

    :catch_4b
    move-exception v3

    :try_start_4c
    invoke-virtual {p0, v3}, Lj6/c4;->b(Ljava/lang/InterruptedException;)V

    :cond_4f
    :goto_4f
    monitor-exit v2
    :try_end_50
    .catchall {:try_start_4c .. :try_end_50} :catchall_79

    :try_start_50
    iget-object v2, p0, Lj6/c4;->u:Lj6/d4;

    .line 5
    iget-object v2, v2, Lj6/d4;->i:Ljava/lang/Object;

    .line 6
    monitor-enter v2
    :try_end_55
    .catchall {:try_start_50 .. :try_end_55} :catchall_7c

    :try_start_55
    iget-object v3, p0, Lj6/c4;->s:Ljava/util/concurrent/BlockingQueue;

    invoke-interface {v3}, Ljava/util/concurrent/BlockingQueue;->peek()Ljava/lang/Object;

    move-result-object v3

    if-nez v3, :cond_74

    iget-object v0, p0, Lj6/c4;->u:Lj6/d4;

    iget-object v0, v0, Lcom/google/android/gms/measurement/internal/e;->a:Lcom/google/android/gms/measurement/internal/d;

    .line 7
    iget-object v0, v0, Lcom/google/android/gms/measurement/internal/d;->g:Lj6/f;

    .line 8
    sget-object v1, Lj6/u2;->i0:Lj6/t2;

    const/4 v3, 0x0

    invoke-virtual {v0, v3, v1}, Lj6/f;->v(Ljava/lang/String;Lj6/t2;)Z

    move-result v0

    if-eqz v0, :cond_6f

    invoke-virtual {p0}, Lj6/c4;->a()V

    :cond_6f
    monitor-exit v2
    :try_end_70
    .catchall {:try_start_55 .. :try_end_70} :catchall_76

    invoke-virtual {p0}, Lj6/c4;->a()V

    return-void

    :cond_74
    :try_start_74
    monitor-exit v2

    goto :goto_1a

    :catchall_76
    move-exception v0

    monitor-exit v2
    :try_end_78
    .catchall {:try_start_74 .. :try_end_78} :catchall_76

    :try_start_78
    throw v0
    :try_end_79
    .catchall {:try_start_78 .. :try_end_79} :catchall_7c

    :catchall_79
    move-exception v0

    :try_start_7a
    monitor-exit v2
    :try_end_7b
    .catchall {:try_start_7a .. :try_end_7b} :catchall_79

    :try_start_7b
    throw v0
    :try_end_7c
    .catchall {:try_start_7b .. :try_end_7c} :catchall_7c

    :catchall_7c
    move-exception v0

    invoke-virtual {p0}, Lj6/c4;->a()V

    throw v0
.end method
