123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448 |
- .class final Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;
- .super Ljava/lang/Object;
- .source "BehaviorSubject.java"
- # interfaces
- .implements Lio/reactivex/disposables/Disposable;
- .implements Lio/reactivex/internal/util/AppendOnlyLinkedArrayList$NonThrowingPredicate;
- # annotations
- .annotation system Ldalvik/annotation/EnclosingClass;
- value = Lio/reactivex/subjects/BehaviorSubject;
- .end annotation
- .annotation system Ldalvik/annotation/InnerClass;
- accessFlags = 0x18
- name = "BehaviorDisposable"
- .end annotation
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- ">",
- "Ljava/lang/Object;",
- "Lio/reactivex/disposables/Disposable;",
- "Lio/reactivex/internal/util/AppendOnlyLinkedArrayList$NonThrowingPredicate<",
- "Ljava/lang/Object;",
- ">;"
- }
- .end annotation
- # instance fields
- .field final actual:Lio/reactivex/Observer;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Lio/reactivex/Observer<",
- "-TT;>;"
- }
- .end annotation
- .end field
- .field volatile cancelled:Z
- .field emitting:Z
- .field fastPath:Z
- .field index:J
- .field next:Z
- .field queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Lio/reactivex/internal/util/AppendOnlyLinkedArrayList<",
- "Ljava/lang/Object;",
- ">;"
- }
- .end annotation
- .end field
- .field final state:Lio/reactivex/subjects/BehaviorSubject;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Lio/reactivex/subjects/BehaviorSubject<",
- "TT;>;"
- }
- .end annotation
- .end field
- # direct methods
- .method constructor <init>(Lio/reactivex/Observer;Lio/reactivex/subjects/BehaviorSubject;)V
- .locals 0
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Lio/reactivex/Observer<",
- "-TT;>;",
- "Lio/reactivex/subjects/BehaviorSubject<",
- "TT;>;)V"
- }
- .end annotation
- .line 406
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- .line 407
- iput-object p1, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->actual:Lio/reactivex/Observer;
- .line 408
- iput-object p2, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->state:Lio/reactivex/subjects/BehaviorSubject;
- return-void
- .end method
- # virtual methods
- .method public dispose()V
- .locals 1
- .line 413
- iget-boolean v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->cancelled:Z
- if-nez v0, :cond_0
- const/4 v0, 0x1
- .line 414
- iput-boolean v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->cancelled:Z
- .line 416
- iget-object v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->state:Lio/reactivex/subjects/BehaviorSubject;
- invoke-virtual {v0, p0}, Lio/reactivex/subjects/BehaviorSubject;->remove(Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;)V
- :cond_0
- return-void
- .end method
- .method emitFirst()V
- .locals 4
- .line 426
- iget-boolean v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->cancelled:Z
- if-eqz v0, :cond_0
- return-void
- .line 430
- :cond_0
- monitor-enter p0
- .line 431
- :try_start_0
- iget-boolean v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->cancelled:Z
- if-eqz v0, :cond_1
- .line 432
- monitor-exit p0
- return-void
- .line 434
- :cond_1
- iget-boolean v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->next:Z
- if-eqz v0, :cond_2
- .line 435
- monitor-exit p0
- return-void
- .line 438
- :cond_2
- iget-object v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->state:Lio/reactivex/subjects/BehaviorSubject;
- .line 439
- iget-object v1, v0, Lio/reactivex/subjects/BehaviorSubject;->readLock:Ljava/util/concurrent/locks/Lock;
- .line 441
- invoke-interface {v1}, Ljava/util/concurrent/locks/Lock;->lock()V
- .line 442
- iget-wide v2, v0, Lio/reactivex/subjects/BehaviorSubject;->index:J
- iput-wide v2, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->index:J
- .line 443
- iget-object v0, v0, Lio/reactivex/subjects/BehaviorSubject;->value:Ljava/util/concurrent/atomic/AtomicReference;
- invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
- move-result-object v0
- .line 444
- invoke-interface {v1}, Ljava/util/concurrent/locks/Lock;->unlock()V
- const/4 v1, 0x1
- if-eqz v0, :cond_3
- const/4 v2, 0x1
- goto :goto_0
- :cond_3
- const/4 v2, 0x0
- .line 446
- :goto_0
- iput-boolean v2, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->emitting:Z
- .line 447
- iput-boolean v1, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->next:Z
- .line 448
- monitor-exit p0
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- if-eqz v0, :cond_5
- .line 451
- invoke-virtual {p0, v0}, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->test(Ljava/lang/Object;)Z
- move-result v0
- if-eqz v0, :cond_4
- return-void
- .line 455
- :cond_4
- invoke-virtual {p0}, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->emitLoop()V
- :cond_5
- return-void
- :catchall_0
- move-exception v0
- .line 448
- :try_start_1
- monitor-exit p0
- :try_end_1
- .catchall {:try_start_1 .. :try_end_1} :catchall_0
- throw v0
- .end method
- .method emitLoop()V
- .locals 2
- .line 495
- :goto_0
- iget-boolean v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->cancelled:Z
- if-eqz v0, :cond_0
- return-void
- .line 499
- :cond_0
- monitor-enter p0
- .line 500
- :try_start_0
- iget-object v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
- if-nez v0, :cond_1
- const/4 v0, 0x0
- .line 502
- iput-boolean v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->emitting:Z
- .line 503
- monitor-exit p0
- return-void
- :cond_1
- const/4 v1, 0x0
- .line 505
- iput-object v1, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
- .line 506
- monitor-exit p0
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- .line 508
- invoke-virtual {v0, p0}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->forEachWhile(Lio/reactivex/internal/util/AppendOnlyLinkedArrayList$NonThrowingPredicate;)V
- goto :goto_0
- :catchall_0
- move-exception v0
- .line 506
- :try_start_1
- monitor-exit p0
- :try_end_1
- .catchall {:try_start_1 .. :try_end_1} :catchall_0
- goto :goto_2
- :goto_1
- throw v0
- :goto_2
- goto :goto_1
- .end method
- .method emitNext(Ljava/lang/Object;J)V
- .locals 3
- .line 460
- iget-boolean v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->cancelled:Z
- if-eqz v0, :cond_0
- return-void
- .line 463
- :cond_0
- iget-boolean v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->fastPath:Z
- if-nez v0, :cond_5
- .line 464
- monitor-enter p0
- .line 465
- :try_start_0
- iget-boolean v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->cancelled:Z
- if-eqz v0, :cond_1
- .line 466
- monitor-exit p0
- return-void
- .line 468
- :cond_1
- iget-wide v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->index:J
- cmp-long v2, v0, p2
- if-nez v2, :cond_2
- .line 469
- monitor-exit p0
- return-void
- .line 471
- :cond_2
- iget-boolean p2, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->emitting:Z
- if-eqz p2, :cond_4
- .line 472
- iget-object p2, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
- if-nez p2, :cond_3
- .line 474
- new-instance p2, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
- const/4 p3, 0x4
- invoke-direct {p2, p3}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;-><init>(I)V
- .line 475
- iput-object p2, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->queue:Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;
- .line 477
- :cond_3
- invoke-virtual {p2, p1}, Lio/reactivex/internal/util/AppendOnlyLinkedArrayList;->add(Ljava/lang/Object;)V
- .line 478
- monitor-exit p0
- return-void
- :cond_4
- const/4 p2, 0x1
- .line 480
- iput-boolean p2, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->next:Z
- .line 481
- monitor-exit p0
- :try_end_0
- .catchall {:try_start_0 .. :try_end_0} :catchall_0
- .line 482
- iput-boolean p2, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->fastPath:Z
- goto :goto_0
- :catchall_0
- move-exception p1
- .line 481
- :try_start_1
- monitor-exit p0
- :try_end_1
- .catchall {:try_start_1 .. :try_end_1} :catchall_0
- throw p1
- .line 485
- :cond_5
- :goto_0
- invoke-virtual {p0, p1}, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->test(Ljava/lang/Object;)Z
- return-void
- .end method
- .method public isDisposed()Z
- .locals 1
- .line 422
- iget-boolean v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->cancelled:Z
- return v0
- .end method
- .method public test(Ljava/lang/Object;)Z
- .locals 1
- .line 490
- iget-boolean v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->cancelled:Z
- if-nez v0, :cond_1
- iget-object v0, p0, Lio/reactivex/subjects/BehaviorSubject$BehaviorDisposable;->actual:Lio/reactivex/Observer;
- invoke-static {p1, v0}, Lio/reactivex/internal/util/NotificationLite;->accept(Ljava/lang/Object;Lio/reactivex/Observer;)Z
- move-result p1
- if-eqz p1, :cond_0
- goto :goto_0
- :cond_0
- const/4 p1, 0x0
- goto :goto_1
- :cond_1
- :goto_0
- const/4 p1, 0x1
- :goto_1
- return p1
- .end method
|