123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363 |
- .class public final Lio/reactivex/internal/queue/MpscLinkedQueue;
- .super Ljava/lang/Object;
- .source "MpscLinkedQueue.java"
- # interfaces
- .implements Lio/reactivex/internal/fuseable/SimplePlainQueue;
- # annotations
- .annotation system Ldalvik/annotation/MemberClasses;
- value = {
- Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- }
- .end annotation
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "<T:",
- "Ljava/lang/Object;",
- ">",
- "Ljava/lang/Object;",
- "Lio/reactivex/internal/fuseable/SimplePlainQueue<",
- "TT;>;"
- }
- .end annotation
- # instance fields
- .field private final consumerNode:Ljava/util/concurrent/atomic/AtomicReference;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Ljava/util/concurrent/atomic/AtomicReference<",
- "Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode<",
- "TT;>;>;"
- }
- .end annotation
- .end field
- .field private final producerNode:Ljava/util/concurrent/atomic/AtomicReference;
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "Ljava/util/concurrent/atomic/AtomicReference<",
- "Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode<",
- "TT;>;>;"
- }
- .end annotation
- .end field
- # direct methods
- .method public constructor <init>()V
- .locals 1
- .line 33
- invoke-direct {p0}, Ljava/lang/Object;-><init>()V
- .line 34
- new-instance v0, Ljava/util/concurrent/atomic/AtomicReference;
- invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicReference;-><init>()V
- iput-object v0, p0, Lio/reactivex/internal/queue/MpscLinkedQueue;->producerNode:Ljava/util/concurrent/atomic/AtomicReference;
- .line 35
- new-instance v0, Ljava/util/concurrent/atomic/AtomicReference;
- invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicReference;-><init>()V
- iput-object v0, p0, Lio/reactivex/internal/queue/MpscLinkedQueue;->consumerNode:Ljava/util/concurrent/atomic/AtomicReference;
- .line 36
- new-instance v0, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- invoke-direct {v0}, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;-><init>()V
- .line 37
- invoke-virtual {p0, v0}, Lio/reactivex/internal/queue/MpscLinkedQueue;->spConsumerNode(Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;)V
- .line 38
- invoke-virtual {p0, v0}, Lio/reactivex/internal/queue/MpscLinkedQueue;->xchgProducerNode(Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;)Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- return-void
- .end method
- # virtual methods
- .method public clear()V
- .locals 1
- .line 116
- :goto_0
- invoke-virtual {p0}, Lio/reactivex/internal/queue/MpscLinkedQueue;->poll()Ljava/lang/Object;
- move-result-object v0
- if-eqz v0, :cond_0
- invoke-virtual {p0}, Lio/reactivex/internal/queue/MpscLinkedQueue;->isEmpty()Z
- move-result v0
- if-nez v0, :cond_0
- goto :goto_0
- :cond_0
- return-void
- .end method
- .method public isEmpty()Z
- .locals 2
- .line 145
- invoke-virtual {p0}, Lio/reactivex/internal/queue/MpscLinkedQueue;->lvConsumerNode()Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- move-result-object v0
- invoke-virtual {p0}, Lio/reactivex/internal/queue/MpscLinkedQueue;->lvProducerNode()Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- move-result-object v1
- if-ne v0, v1, :cond_0
- const/4 v0, 0x1
- goto :goto_0
- :cond_0
- const/4 v0, 0x0
- :goto_0
- return v0
- .end method
- .method lpConsumerNode()Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "()",
- "Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode<",
- "TT;>;"
- }
- .end annotation
- .line 129
- iget-object v0, p0, Lio/reactivex/internal/queue/MpscLinkedQueue;->consumerNode:Ljava/util/concurrent/atomic/AtomicReference;
- invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
- move-result-object v0
- check-cast v0, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- return-object v0
- .end method
- .method lvConsumerNode()Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "()",
- "Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode<",
- "TT;>;"
- }
- .end annotation
- .line 125
- iget-object v0, p0, Lio/reactivex/internal/queue/MpscLinkedQueue;->consumerNode:Ljava/util/concurrent/atomic/AtomicReference;
- invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
- move-result-object v0
- check-cast v0, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- return-object v0
- .end method
- .method lvProducerNode()Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "()",
- "Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode<",
- "TT;>;"
- }
- .end annotation
- .line 119
- iget-object v0, p0, Lio/reactivex/internal/queue/MpscLinkedQueue;->producerNode:Ljava/util/concurrent/atomic/AtomicReference;
- invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
- move-result-object v0
- check-cast v0, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- return-object v0
- .end method
- .method public offer(Ljava/lang/Object;)Z
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(TT;)Z"
- }
- .end annotation
- if-eqz p1, :cond_0
- .line 61
- new-instance v0, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- invoke-direct {v0, p1}, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;-><init>(Ljava/lang/Object;)V
- .line 62
- invoke-virtual {p0, v0}, Lio/reactivex/internal/queue/MpscLinkedQueue;->xchgProducerNode(Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;)Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- move-result-object p1
- .line 65
- invoke-virtual {p1, v0}, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;->soNext(Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;)V
- const/4 p1, 0x1
- return p1
- .line 59
- :cond_0
- new-instance p1, Ljava/lang/NullPointerException;
- const-string v0, "Null is not a valid element"
- invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
- throw p1
- .end method
- .method public offer(Ljava/lang/Object;Ljava/lang/Object;)Z
- .locals 0
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(TT;TT;)Z"
- }
- .end annotation
- .line 109
- invoke-virtual {p0, p1}, Lio/reactivex/internal/queue/MpscLinkedQueue;->offer(Ljava/lang/Object;)Z
- .line 110
- invoke-virtual {p0, p2}, Lio/reactivex/internal/queue/MpscLinkedQueue;->offer(Ljava/lang/Object;)Z
- const/4 p1, 0x1
- return p1
- .end method
- .method public poll()Ljava/lang/Object;
- .locals 2
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "()TT;"
- }
- .end annotation
- .line 86
- invoke-virtual {p0}, Lio/reactivex/internal/queue/MpscLinkedQueue;->lpConsumerNode()Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- move-result-object v0
- .line 87
- invoke-virtual {v0}, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;->lvNext()Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- move-result-object v1
- if-eqz v1, :cond_0
- .line 90
- invoke-virtual {v1}, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;->getAndNullValue()Ljava/lang/Object;
- move-result-object v0
- .line 91
- invoke-virtual {p0, v1}, Lio/reactivex/internal/queue/MpscLinkedQueue;->spConsumerNode(Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;)V
- return-object v0
- .line 94
- :cond_0
- invoke-virtual {p0}, Lio/reactivex/internal/queue/MpscLinkedQueue;->lvProducerNode()Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- move-result-object v1
- if-eq v0, v1, :cond_2
- .line 96
- :goto_0
- invoke-virtual {v0}, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;->lvNext()Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- move-result-object v1
- if-nez v1, :cond_1
- goto :goto_0
- .line 100
- :cond_1
- invoke-virtual {v1}, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;->getAndNullValue()Ljava/lang/Object;
- move-result-object v0
- .line 101
- invoke-virtual {p0, v1}, Lio/reactivex/internal/queue/MpscLinkedQueue;->spConsumerNode(Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;)V
- return-object v0
- :cond_2
- const/4 v0, 0x0
- return-object v0
- .end method
- .method spConsumerNode(Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;)V
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode<",
- "TT;>;)V"
- }
- .end annotation
- .line 132
- iget-object v0, p0, Lio/reactivex/internal/queue/MpscLinkedQueue;->consumerNode:Ljava/util/concurrent/atomic/AtomicReference;
- invoke-virtual {v0, p1}, Ljava/util/concurrent/atomic/AtomicReference;->lazySet(Ljava/lang/Object;)V
- return-void
- .end method
- .method xchgProducerNode(Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;)Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- .locals 1
- .annotation system Ldalvik/annotation/Signature;
- value = {
- "(",
- "Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode<",
- "TT;>;)",
- "Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode<",
- "TT;>;"
- }
- .end annotation
- .line 122
- iget-object v0, p0, Lio/reactivex/internal/queue/MpscLinkedQueue;->producerNode:Ljava/util/concurrent/atomic/AtomicReference;
- invoke-virtual {v0, p1}, Ljava/util/concurrent/atomic/AtomicReference;->getAndSet(Ljava/lang/Object;)Ljava/lang/Object;
- move-result-object p1
- check-cast p1, Lio/reactivex/internal/queue/MpscLinkedQueue$LinkedQueueNode;
- return-object p1
- .end method
|