.class public abstract Lx/a/s0; .super Lx/a/r0; .source "EventLoop.kt" # interfaces .implements Lx/a/i0; # annotations .annotation system Ldalvik/annotation/MemberClasses; value = { Lx/a/s0$b;, Lx/a/s0$a; } .end annotation # static fields .field public static final g:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; .field public static final h:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; # instance fields .field public volatile _delayed:Ljava/lang/Object; .field public volatile _queue:Ljava/lang/Object; .field public volatile isCompleted:Z # direct methods .method public static constructor ()V .locals 3 const-class v0, Ljava/lang/Object; const-class v1, Lx/a/s0; const-string v2, "_queue" invoke-static {v1, v0, v2}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v2 sput-object v2, Lx/a/s0;->g:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; const-string v2, "_delayed" invoke-static {v1, v0, v2}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; move-result-object v0 sput-object v0, Lx/a/s0;->h:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; return-void .end method .method public constructor ()V .locals 1 invoke-direct {p0}, Lx/a/r0;->()V const/4 v0, 0x0 iput-object v0, p0, Lx/a/s0;->_queue:Ljava/lang/Object; iput-object v0, p0, Lx/a/s0;->_delayed:Ljava/lang/Object; return-void .end method # virtual methods .method public a(JLx/a/h;)V .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "(J", "Lx/a/h<", "-", "Lkotlin/Unit;", ">;)V" } .end annotation if-eqz p3, :cond_0 new-instance v0, Lx/a/s0$a; invoke-direct {v0, p0, p1, p2, p3}, Lx/a/s0$a;->(Lx/a/s0;JLx/a/h;)V invoke-virtual {p0, v0}, Lx/a/s0;->a(Lx/a/s0$b;)V return-void :cond_0 const-string p1, "continuation" invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V const/4 p1, 0x0 throw p1 .end method .method public final a(Ljava/lang/Runnable;)V .locals 1 if-eqz p1, :cond_2 invoke-virtual {p0, p1}, Lx/a/s0;->b(Ljava/lang/Runnable;)Z move-result v0 if-eqz v0, :cond_0 invoke-virtual {p0}, Lx/a/s0;->i()Ljava/lang/Thread; move-result-object p1 invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; move-result-object v0 if-eq v0, p1, :cond_1 invoke-static {}, Lx/a/w1;->a()Lx/a/v1; move-result-object v0 check-cast v0, Lx/a/h0; invoke-virtual {v0, p1}, Lx/a/h0;->a(Ljava/lang/Thread;)V goto :goto_0 :cond_0 sget-object v0, Lx/a/f0;->j:Lx/a/f0; invoke-virtual {v0, p1}, Lx/a/s0;->a(Ljava/lang/Runnable;)V :cond_1 :goto_0 return-void :cond_2 const-string p1, "task" invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V const/4 p1, 0x0 throw p1 .end method .method public final a(Lkotlin/coroutines/CoroutineContext;Ljava/lang/Runnable;)V .locals 1 const/4 v0, 0x0 if-eqz p1, :cond_1 if-eqz p2, :cond_0 invoke-virtual {p0, p2}, Lx/a/s0;->a(Ljava/lang/Runnable;)V return-void :cond_0 const-string p1, "block" invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V throw v0 :cond_1 const-string p1, "context" invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V throw v0 .end method .method public final a(Lx/a/s0$b;)V .locals 4 const/4 v0, 0x0 if-eqz p1, :cond_9 iget-boolean v1, p0, Lx/a/s0;->isCompleted:Z const/4 v2, 0x1 if-eqz v1, :cond_0 const/4 v1, 0x1 goto :goto_1 :cond_0 iget-object v1, p0, Lx/a/s0;->_delayed:Ljava/lang/Object; check-cast v1, Lx/a/a2/z; if-eqz v1, :cond_1 goto :goto_0 :cond_1 sget-object v1, Lx/a/s0;->h:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; new-instance v3, Lx/a/a2/z; invoke-direct {v3}, Lx/a/a2/z;->()V invoke-virtual {v1, p0, v0, v3}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z iget-object v1, p0, Lx/a/s0;->_delayed:Ljava/lang/Object; if-eqz v1, :cond_8 check-cast v1, Lx/a/a2/z; :goto_0 invoke-virtual {p1, v1, p0}, Lx/a/s0$b;->a(Lx/a/a2/z;Lx/a/s0;)I move-result v1 :goto_1 if-eqz v1, :cond_4 if-eq v1, v2, :cond_3 const/4 p1, 0x2 if-ne v1, p1, :cond_2 goto :goto_3 :cond_2 new-instance p1, Ljava/lang/IllegalStateException; const-string v0, "unexpected result" invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v0 invoke-direct {p1, v0}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw p1 :cond_3 sget-object v0, Lx/a/f0;->j:Lx/a/f0; invoke-virtual {v0, p1}, Lx/a/s0;->a(Lx/a/s0$b;)V goto :goto_3 :cond_4 iget-object v1, p0, Lx/a/s0;->_delayed:Ljava/lang/Object; check-cast v1, Lx/a/a2/z; if-eqz v1, :cond_5 invoke-virtual {v1}, Lx/a/a2/z;->a()Lx/a/a2/a0; move-result-object v0 check-cast v0, Lx/a/s0$b; :cond_5 if-ne v0, p1, :cond_6 goto :goto_2 :cond_6 const/4 v2, 0x0 :goto_2 if-eqz v2, :cond_7 invoke-virtual {p0}, Lx/a/s0;->i()Ljava/lang/Thread; move-result-object p1 invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; move-result-object v0 if-eq v0, p1, :cond_7 invoke-static {}, Lx/a/w1;->a()Lx/a/v1; move-result-object v0 check-cast v0, Lx/a/h0; invoke-virtual {v0, p1}, Lx/a/h0;->a(Ljava/lang/Thread;)V :cond_7 :goto_3 return-void :cond_8 invoke-static {}, Lw/u/b/j;->throwNpe()V throw v0 :cond_9 const-string p1, "delayedTask" invoke-static {p1}, Lw/u/b/j;->a(Ljava/lang/String;)V throw v0 .end method .method public final b(Ljava/lang/Runnable;)Z .locals 5 :cond_0 :goto_0 iget-object v0, p0, Lx/a/s0;->_queue:Ljava/lang/Object; iget-boolean v1, p0, Lx/a/s0;->isCompleted:Z const/4 v2, 0x0 if-eqz v1, :cond_1 return v2 :cond_1 const/4 v1, 0x1 if-nez v0, :cond_2 sget-object v0, Lx/a/s0;->g:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; const/4 v2, 0x0 invoke-virtual {v0, p0, v2, p1}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 return v1 :cond_2 instance-of v3, v0, Lx/a/a2/p; if-eqz v3, :cond_6 move-object v3, v0 check-cast v3, Lx/a/a2/p; invoke-virtual {v3, p1}, Lx/a/a2/p;->a(Ljava/lang/Object;)I move-result v4 if-eqz v4, :cond_5 if-eq v4, v1, :cond_4 const/4 v0, 0x2 if-eq v4, v0, :cond_3 goto :goto_0 :cond_3 return v2 :cond_4 sget-object v1, Lx/a/s0;->g:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; invoke-virtual {v3}, Lx/a/a2/p;->c()Lx/a/a2/p; move-result-object v2 invoke-virtual {v1, p0, v0, v2}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z goto :goto_0 :cond_5 return v1 :cond_6 invoke-static {}, Lx/a/t0;->a()Lx/a/a2/v; move-result-object v3 if-ne v0, v3, :cond_7 return v2 :cond_7 new-instance v2, Lx/a/a2/p; const/16 v3, 0x8 invoke-direct {v2, v3, v1}, Lx/a/a2/p;->(IZ)V move-object v3, v0 check-cast v3, Ljava/lang/Runnable; invoke-virtual {v2, v3}, Lx/a/a2/p;->a(Ljava/lang/Object;)I invoke-virtual {v2, p1}, Lx/a/a2/p;->a(Ljava/lang/Object;)I sget-object v3, Lx/a/s0;->g:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; invoke-virtual {v3, p0, v0, v2}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_0 return v1 .end method .method public e()J .locals 6 invoke-super {p0}, Lx/a/r0;->e()J move-result-wide v0 const-wide/16 v2, 0x0 cmp-long v4, v0, v2 if-nez v4, :cond_0 return-wide v2 :cond_0 iget-object v0, p0, Lx/a/s0;->_queue:Ljava/lang/Object; const-wide v4, 0x7fffffffffffffffL if-nez v0, :cond_1 goto :goto_0 :cond_1 instance-of v1, v0, Lx/a/a2/p; if-eqz v1, :cond_5 check-cast v0, Lx/a/a2/p; invoke-virtual {v0}, Lx/a/a2/p;->b()Z move-result v0 if-nez v0, :cond_2 return-wide v2 :cond_2 :goto_0 iget-object v0, p0, Lx/a/s0;->_delayed:Ljava/lang/Object; check-cast v0, Lx/a/a2/z; if-eqz v0, :cond_4 invoke-virtual {v0}, Lx/a/a2/z;->a()Lx/a/a2/a0; move-result-object v0 check-cast v0, Lx/a/s0$b; if-eqz v0, :cond_4 iget-wide v0, v0, Lx/a/s0$b;->f:J sget-object v4, Lx/a/w1;->a:Lx/a/v1; check-cast v4, Lx/a/h0; invoke-virtual {v4}, Lx/a/h0;->a()J move-result-wide v4 sub-long/2addr v0, v4 cmp-long v4, v0, v2 if-gez v4, :cond_3 move-wide v0, v2 :cond_3 return-wide v0 :cond_4 return-wide v4 :cond_5 sget-object v1, Lx/a/t0;->b:Lx/a/a2/v; if-ne v0, v1, :cond_6 return-wide v4 :cond_6 return-wide v2 .end method .method public g()J .locals 15 invoke-virtual {p0}, Lx/a/r0;->h()Z move-result v0 if-eqz v0, :cond_0 invoke-virtual {p0}, Lx/a/s0;->e()J move-result-wide v0 return-wide v0 :cond_0 iget-object v0, p0, Lx/a/s0;->_delayed:Ljava/lang/Object; check-cast v0, Lx/a/a2/z; const-wide/16 v1, 0x0 const/4 v3, 0x0 const/4 v4, 0x0 if-eqz v0, :cond_7 iget v5, v0, Lx/a/a2/z;->size:I const/4 v6, 0x1 if-nez v5, :cond_1 const/4 v5, 0x1 goto :goto_0 :cond_1 const/4 v5, 0x0 :goto_0 if-nez v5, :cond_7 sget-object v5, Lx/a/w1;->a:Lx/a/v1; check-cast v5, Lx/a/h0; invoke-virtual {v5}, Lx/a/h0;->a()J move-result-wide v7 :goto_1 monitor-enter v0 :try_start_0 iget-object v5, v0, Lx/a/a2/z;->a:[Lx/a/a2/a0; if-eqz v5, :cond_2 aget-object v5, v5, v4 goto :goto_2 :cond_2 move-object v5, v3 :goto_2 if-eqz v5, :cond_6 check-cast v5, Lx/a/s0$b; iget-wide v9, v5, Lx/a/s0$b;->f:J sub-long v9, v7, v9 cmp-long v11, v9, v1 if-ltz v11, :cond_3 const/4 v9, 0x1 goto :goto_3 :cond_3 const/4 v9, 0x0 :goto_3 if-eqz v9, :cond_4 invoke-virtual {p0, v5}, Lx/a/s0;->b(Ljava/lang/Runnable;)Z move-result v5 goto :goto_4 :cond_4 const/4 v5, 0x0 :goto_4 if-eqz v5, :cond_5 invoke-virtual {v0, v4}, Lx/a/a2/z;->a(I)Lx/a/a2/a0; move-result-object v5 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 goto :goto_5 :cond_5 move-object v5, v3 :goto_5 monitor-exit v0 goto :goto_6 :catchall_0 move-exception v1 goto :goto_7 :cond_6 monitor-exit v0 move-object v5, v3 :goto_6 check-cast v5, Lx/a/s0$b; if-eqz v5, :cond_7 goto :goto_1 :goto_7 monitor-exit v0 throw v1 :cond_7 :goto_8 iget-object v0, p0, Lx/a/s0;->_queue:Ljava/lang/Object; if-nez v0, :cond_8 goto/16 :goto_e :cond_8 instance-of v5, v0, Lx/a/a2/p; if-eqz v5, :cond_12 move-object v5, v0 check-cast v5, Lx/a/a2/p; :cond_9 :goto_9 iget-wide v8, v5, Lx/a/a2/p;->_state$internal:J const-wide/high16 v6, 0x1000000000000000L and-long/2addr v6, v8 cmp-long v10, v6, v1 if-eqz v10, :cond_a sget-object v6, Lx/a/a2/p;->g:Lx/a/a2/v; goto :goto_d :cond_a const-wide/32 v6, 0x3fffffff and-long/2addr v6, v8 shr-long/2addr v6, v4 long-to-int v12, v6 const-wide v6, 0xfffffffc0000000L and-long/2addr v6, v8 const/16 v10, 0x1e shr-long/2addr v6, v10 long-to-int v7, v6 iget v6, v5, Lx/a/a2/p;->a:I and-int/2addr v7, v6 and-int/2addr v6, v12 if-ne v7, v6, :cond_b goto :goto_a :cond_b iget-object v7, v5, Lx/a/a2/p;->b:Ljava/util/concurrent/atomic/AtomicReferenceArray; invoke-virtual {v7, v6}, Ljava/util/concurrent/atomic/AtomicReferenceArray;->get(I)Ljava/lang/Object; move-result-object v13 if-nez v13, :cond_c iget-boolean v6, v5, Lx/a/a2/p;->d:Z if-eqz v6, :cond_9 goto :goto_a :cond_c instance-of v6, v13, Lx/a/a2/p$b; if-eqz v6, :cond_d :goto_a move-object v6, v3 goto :goto_d :cond_d add-int/lit8 v6, v12, 0x1 const v7, 0x3fffffff # 1.9999999f and-int v14, v6, v7 sget-object v6, Lx/a/a2/p;->f:Ljava/util/concurrent/atomic/AtomicLongFieldUpdater; sget-object v7, Lx/a/a2/p;->h:Lx/a/a2/p$a; invoke-virtual {v7, v8, v9, v14}, Lx/a/a2/p$a;->a(JI)J move-result-wide v10 move-object v7, v5 invoke-virtual/range {v6 .. v11}, Ljava/util/concurrent/atomic/AtomicLongFieldUpdater;->compareAndSet(Ljava/lang/Object;JJ)Z move-result v6 if-eqz v6, :cond_e iget-object v6, v5, Lx/a/a2/p;->b:Ljava/util/concurrent/atomic/AtomicReferenceArray; iget v7, v5, Lx/a/a2/p;->a:I and-int/2addr v7, v12 invoke-virtual {v6, v7, v3}, Ljava/util/concurrent/atomic/AtomicReferenceArray;->set(ILjava/lang/Object;)V goto :goto_c :cond_e iget-boolean v6, v5, Lx/a/a2/p;->d:Z if-nez v6, :cond_f goto :goto_9 :cond_f move-object v6, v5 :goto_b invoke-static {v6, v12, v14}, Lx/a/a2/p;->a(Lx/a/a2/p;II)Lx/a/a2/p; move-result-object v6 if-eqz v6, :cond_10 goto :goto_b :cond_10 :goto_c move-object v6, v13 :goto_d sget-object v7, Lx/a/a2/p;->g:Lx/a/a2/v; if-eq v6, v7, :cond_11 move-object v3, v6 check-cast v3, Ljava/lang/Runnable; goto :goto_e :cond_11 sget-object v6, Lx/a/s0;->g:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; invoke-virtual {v5}, Lx/a/a2/p;->c()Lx/a/a2/p; move-result-object v5 invoke-virtual {v6, p0, v0, v5}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z goto/16 :goto_8 :cond_12 sget-object v5, Lx/a/t0;->b:Lx/a/a2/v; if-ne v0, v5, :cond_13 goto :goto_e :cond_13 sget-object v5, Lx/a/s0;->g:Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater; invoke-virtual {v5, p0, v0, v3}, Ljava/util/concurrent/atomic/AtomicReferenceFieldUpdater;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z move-result v5 if-eqz v5, :cond_7 move-object v3, v0 check-cast v3, Ljava/lang/Runnable; :goto_e if-eqz v3, :cond_14 invoke-interface {v3}, Ljava/lang/Runnable;->run()V :cond_14 invoke-virtual {p0}, Lx/a/s0;->e()J move-result-wide v0 return-wide v0 .end method .method public abstract i()Ljava/lang/Thread; .end method .method public j()Z .locals 4 iget-object v0, p0, Lx/a/r0;->f:Lx/a/a2/a; const/4 v1, 0x0 const/4 v2, 0x1 if-eqz v0, :cond_1 iget v3, v0, Lx/a/a2/a;->b:I iget v0, v0, Lx/a/a2/a;->c:I if-ne v3, v0, :cond_0 goto :goto_0 :cond_0 const/4 v0, 0x0 goto :goto_1 :cond_1 :goto_0 const/4 v0, 0x1 :goto_1 if-nez v0, :cond_2 return v1 :cond_2 iget-object v0, p0, Lx/a/s0;->_delayed:Ljava/lang/Object; check-cast v0, Lx/a/a2/z; if-eqz v0, :cond_4 iget v0, v0, Lx/a/a2/z;->size:I if-nez v0, :cond_3 const/4 v0, 0x1 goto :goto_2 :cond_3 const/4 v0, 0x0 :goto_2 if-nez v0, :cond_4 return v1 :cond_4 iget-object v0, p0, Lx/a/s0;->_queue:Ljava/lang/Object; if-nez v0, :cond_5 goto :goto_3 :cond_5 instance-of v3, v0, Lx/a/a2/p; if-eqz v3, :cond_6 check-cast v0, Lx/a/a2/p; invoke-virtual {v0}, Lx/a/a2/p;->b()Z move-result v1 goto :goto_4 :cond_6 sget-object v3, Lx/a/t0;->b:Lx/a/a2/v; if-ne v0, v3, :cond_7 :goto_3 const/4 v1, 0x1 :cond_7 :goto_4 return v1 .end method