f.smali

.class public final Lio/reactivex/internal/disposables/f;
.super Ljava/lang/Object;
.source "SourceFile"

# interfaces
.implements Lio/reactivex/disposables/b;
.implements Lio/reactivex/internal/disposables/b;


# instance fields
.field public a:Ljava/util/LinkedList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Lio/reactivex/disposables/b;",
            ">;"
        }
    .end annotation
.end field

.field public volatile b:Z


# direct methods
.method public constructor <init>()V
    .registers 1

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

    return-void
.end method


# virtual methods
.method public final a(Lio/reactivex/disposables/b;)Z
    .registers 3

    .line 1
    invoke-virtual {p0, p1}, Lio/reactivex/internal/disposables/f;->b(Lio/reactivex/disposables/b;)Z

    move-result v0

    if-eqz v0, :cond_d

    .line 2
    check-cast p1, Lio/reactivex/internal/schedulers/l;

    invoke-virtual {p1}, Lio/reactivex/internal/schedulers/l;->dispose()V

    const/4 p1, 0x1

    return p1

    :cond_d
    const/4 p1, 0x0

    return p1
.end method

.method public final b(Lio/reactivex/disposables/b;)Z
    .registers 4

    const-string v0, "Disposable item is null"

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

    .line 2
    iget-boolean v0, p0, Lio/reactivex/internal/disposables/f;->b:Z

    const/4 v1, 0x0

    if-eqz v0, :cond_b

    return v1

    .line 3
    :cond_b
    monitor-enter p0

    .line 4
    :try_start_c
    iget-boolean v0, p0, Lio/reactivex/internal/disposables/f;->b:Z

    if-eqz v0, :cond_12

    .line 5
    monitor-exit p0

    return v1

    .line 6
    :cond_12
    iget-object v0, p0, Lio/reactivex/internal/disposables/f;->a:Ljava/util/LinkedList;

    if-eqz v0, :cond_20

    .line 7
    invoke-virtual {v0, p1}, Ljava/util/LinkedList;->remove(Ljava/lang/Object;)Z

    move-result p1

    if-nez p1, :cond_1d

    goto :goto_20

    .line 8
    :cond_1d
    monitor-exit p0

    const/4 p1, 0x1

    return p1

    .line 9
    :cond_20
    :goto_20
    monitor-exit p0

    return v1

    :catchall_22
    move-exception p1

    .line 10
    monitor-exit p0
    :try_end_24
    .catchall {:try_start_c .. :try_end_24} :catchall_22

    throw p1
.end method

.method public final c(Lio/reactivex/disposables/b;)Z
    .registers 3

    .line 1
    iget-boolean v0, p0, Lio/reactivex/internal/disposables/f;->b:Z

    if-nez v0, :cond_1f

    .line 2
    monitor-enter p0

    .line 3
    :try_start_5
    iget-boolean v0, p0, Lio/reactivex/internal/disposables/f;->b:Z

    if-nez v0, :cond_1a

    .line 4
    iget-object v0, p0, Lio/reactivex/internal/disposables/f;->a:Ljava/util/LinkedList;

    if-nez v0, :cond_14

    .line 5
    new-instance v0, Ljava/util/LinkedList;

    invoke-direct {v0}, Ljava/util/LinkedList;-><init>()V

    .line 6
    iput-object v0, p0, Lio/reactivex/internal/disposables/f;->a:Ljava/util/LinkedList;

    .line 7
    :cond_14
    invoke-interface {v0, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    const/4 p1, 0x1

    .line 8
    monitor-exit p0

    return p1

    .line 9
    :cond_1a
    monitor-exit p0

    goto :goto_1f

    :catchall_1c
    move-exception p1

    monitor-exit p0
    :try_end_1e
    .catchall {:try_start_5 .. :try_end_1e} :catchall_1c

    throw p1

    .line 10
    :cond_1f
    :goto_1f
    invoke-interface {p1}, Lio/reactivex/disposables/b;->dispose()V

    const/4 p1, 0x0

    return p1
.end method

.method public final dispose()V
    .registers 5

    .line 1
    iget-boolean v0, p0, Lio/reactivex/internal/disposables/f;->b:Z

    if-eqz v0, :cond_5

    return-void

    .line 2
    :cond_5
    monitor-enter p0

    .line 3
    :try_start_6
    iget-boolean v0, p0, Lio/reactivex/internal/disposables/f;->b:Z

    if-eqz v0, :cond_c

    .line 4
    monitor-exit p0

    return-void

    :cond_c
    const/4 v0, 0x1

    .line 5
    iput-boolean v0, p0, Lio/reactivex/internal/disposables/f;->b:Z

    .line 6
    iget-object v1, p0, Lio/reactivex/internal/disposables/f;->a:Ljava/util/LinkedList;

    const/4 v2, 0x0

    .line 7
    iput-object v2, p0, Lio/reactivex/internal/disposables/f;->a:Ljava/util/LinkedList;

    .line 8
    monitor-exit p0
    :try_end_15
    .catchall {:try_start_6 .. :try_end_15} :catchall_56

    if-nez v1, :cond_18

    goto :goto_55

    .line 9
    :cond_18
    invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_1c
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_3b

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lio/reactivex/disposables/b;

    .line 10
    :try_start_28
    invoke-interface {v3}, Lio/reactivex/disposables/b;->dispose()V
    :try_end_2b
    .catchall {:try_start_28 .. :try_end_2b} :catchall_2c

    goto :goto_1c

    :catchall_2c
    move-exception v3

    .line 11
    invoke-static {v3}, Lcom/shopee/app/dre/codepush/task/a;->m(Ljava/lang/Throwable;)V

    if-nez v2, :cond_37

    .line 12
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 13
    :cond_37
    invoke-interface {v2, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    goto :goto_1c

    :cond_3b
    if-eqz v2, :cond_55

    .line 14
    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v1

    if-ne v1, v0, :cond_4f

    const/4 v0, 0x0

    .line 15
    invoke-interface {v2, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/Throwable;

    invoke-static {v0}, Lio/reactivex/internal/util/g;->d(Ljava/lang/Throwable;)Ljava/lang/RuntimeException;

    move-result-object v0

    throw v0

    .line 16
    :cond_4f
    new-instance v0, Lio/reactivex/exceptions/a;

    invoke-direct {v0, v2}, Lio/reactivex/exceptions/a;-><init>(Ljava/lang/Iterable;)V

    throw v0

    :cond_55
    :goto_55
    return-void

    :catchall_56
    move-exception v0

    .line 17
    :try_start_57
    monitor-exit p0
    :try_end_58
    .catchall {:try_start_57 .. :try_end_58} :catchall_56

    throw v0
.end method

.method public final isDisposed()Z
    .registers 2

    iget-boolean v0, p0, Lio/reactivex/internal/disposables/f;->b:Z

    return v0
.end method