.class public abstract Lkotlinx/coroutines/EventLoopImplBase$DelayedTask; .super Ljava/lang/Object; .source "SourceFile" # interfaces .implements Ljava/lang/Runnable; .implements Ljava/lang/Comparable; .implements Lkotlinx/coroutines/DisposableHandle; .implements Lkotlinx/coroutines/internal/ThreadSafeHeapNode; # annotations .annotation system Ldalvik/annotation/EnclosingClass; value = Lkotlinx/coroutines/EventLoopImplBase; .end annotation .annotation system Ldalvik/annotation/InnerClass; accessFlags = 0x409 name = "DelayedTask" .end annotation # instance fields .field private volatile _heap:Ljava/lang/Object; .field public index:I .field public nanoTime:J # direct methods .method public constructor (J)V .locals 0 .line 413 invoke-direct {p0}, Ljava/lang/Object;->()V iput-wide p1, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->nanoTime:J const/4 p1, -0x1 iput p1, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->index:I return-void .end method # virtual methods .method public bridge synthetic compareTo(Ljava/lang/Object;)I .locals 0 .line 407 check-cast p1, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask; invoke-virtual {p0, p1}, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->compareTo(Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;)I move-result p1 return p1 .end method .method public compareTo(Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;)I .locals 4 iget-wide v0, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->nanoTime:J .line 427 iget-wide v2, p1, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->nanoTime:J sub-long/2addr v0, v2 const-wide/16 v2, 0x0 cmp-long p1, v0, v2 if-lez p1, :cond_0 const/4 p1, 0x1 goto :goto_0 :cond_0 if-gez p1, :cond_1 const/4 p1, -0x1 goto :goto_0 :cond_1 const/4 p1, 0x0 :goto_0 return p1 .end method .method public final dispose()V .locals 2 .line 20 monitor-enter p0 :try_start_0 iget-object v0, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->_heap:Ljava/lang/Object; .line 481 invoke-static {}, Lkotlinx/coroutines/EventLoop_commonKt;->access$getDISPOSED_TASK$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 if-ne v0, v1, :cond_0 monitor-exit p0 return-void .line 482 :cond_0 :try_start_1 instance-of v1, v0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTaskQueue; if-eqz v1, :cond_1 check-cast v0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTaskQueue; goto :goto_0 :catchall_0 move-exception v0 goto :goto_1 :cond_1 const/4 v0, 0x0 :goto_0 if-eqz v0, :cond_2 invoke-virtual {v0, p0}, Lkotlinx/coroutines/internal/ThreadSafeHeap;->remove(Lkotlinx/coroutines/internal/ThreadSafeHeapNode;)Z .line 483 :cond_2 invoke-static {}, Lkotlinx/coroutines/EventLoop_commonKt;->access$getDISPOSED_TASK$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v0 iput-object v0, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->_heap:Ljava/lang/Object; .line 484 sget-object v0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 .line 20 monitor-exit p0 return-void :goto_1 monitor-exit p0 throw v0 .end method .method public getHeap()Lkotlinx/coroutines/internal/ThreadSafeHeap; .locals 2 iget-object v0, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->_heap:Ljava/lang/Object; .line 418 instance-of v1, v0, Lkotlinx/coroutines/internal/ThreadSafeHeap; if-eqz v1, :cond_0 check-cast v0, Lkotlinx/coroutines/internal/ThreadSafeHeap; goto :goto_0 :cond_0 const/4 v0, 0x0 :goto_0 return-object v0 .end method .method public getIndex()I .locals 1 iget v0, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->index:I return v0 .end method .method public final scheduleTask(JLkotlinx/coroutines/EventLoopImplBase$DelayedTaskQueue;Lkotlinx/coroutines/EventLoopImplBase;)I .locals 7 .line 20 monitor-enter p0 :try_start_0 iget-object v0, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->_heap:Ljava/lang/Object; .line 438 invoke-static {}, Lkotlinx/coroutines/EventLoop_commonKt;->access$getDISPOSED_TASK$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 if-ne v0, v1, :cond_0 monitor-exit p0 const/4 p1, 0x2 return p1 .line 20 :cond_0 :try_start_1 monitor-enter p3 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 .line 73 :try_start_2 invoke-virtual {p3}, Lkotlinx/coroutines/internal/ThreadSafeHeap;->firstImpl()Lkotlinx/coroutines/internal/ThreadSafeHeapNode; move-result-object v0 check-cast v0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask; .line 440 invoke-static {p4}, Lkotlinx/coroutines/EventLoopImplBase;->access$isCompleted(Lkotlinx/coroutines/EventLoopImplBase;)Z move-result p4 :try_end_2 .catchall {:try_start_2 .. :try_end_2} :catchall_1 if-eqz p4, :cond_1 :try_start_3 monitor-exit p3 :try_end_3 .catchall {:try_start_3 .. :try_end_3} :catchall_0 monitor-exit p0 const/4 p1, 0x1 return p1 :catchall_0 move-exception p1 goto :goto_3 :cond_1 const-wide/16 v1, 0x0 if-nez v0, :cond_2 .line 453 :try_start_4 iput-wide p1, p3, Lkotlinx/coroutines/EventLoopImplBase$DelayedTaskQueue;->timeNow:J goto :goto_1 :catchall_1 move-exception p1 goto :goto_2 .line 460 :cond_2 iget-wide v3, v0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->nanoTime:J sub-long v5, v3, p1 cmp-long p4, v5, v1 if-ltz p4, :cond_3 goto :goto_0 :cond_3 move-wide p1, v3 .line 464 :goto_0 iget-wide v3, p3, Lkotlinx/coroutines/EventLoopImplBase$DelayedTaskQueue;->timeNow:J sub-long v3, p1, v3 cmp-long p4, v3, v1 if-lez p4, :cond_4 iput-wide p1, p3, Lkotlinx/coroutines/EventLoopImplBase$DelayedTaskQueue;->timeNow:J :cond_4 :goto_1 iget-wide p1, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->nanoTime:J .line 473 iget-wide v3, p3, Lkotlinx/coroutines/EventLoopImplBase$DelayedTaskQueue;->timeNow:J sub-long/2addr p1, v3 cmp-long p1, p1, v1 if-gez p1, :cond_5 iput-wide v3, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->nanoTime:J .line 74 :cond_5 invoke-virtual {p3, p0}, Lkotlinx/coroutines/internal/ThreadSafeHeap;->addImpl(Lkotlinx/coroutines/internal/ThreadSafeHeapNode;)V :try_end_4 .catchall {:try_start_4 .. :try_end_4} :catchall_1 .line 20 :try_start_5 monitor-exit p3 :try_end_5 .catchall {:try_start_5 .. :try_end_5} :catchall_0 .line 476 monitor-exit p0 const/4 p1, 0x0 return p1 .line 20 :goto_2 :try_start_6 monitor-exit p3 throw p1 :try_end_6 .catchall {:try_start_6 .. :try_end_6} :catchall_0 .line 476 :goto_3 monitor-exit p0 throw p1 .end method .method public setHeap(Lkotlinx/coroutines/internal/ThreadSafeHeap;)V .locals 2 iget-object v0, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->_heap:Ljava/lang/Object; .line 420 invoke-static {}, Lkotlinx/coroutines/EventLoop_commonKt;->access$getDISPOSED_TASK$p()Lkotlinx/coroutines/internal/Symbol; move-result-object v1 if-eq v0, v1, :cond_0 iput-object p1, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->_heap:Ljava/lang/Object; return-void :cond_0 new-instance p1, Ljava/lang/IllegalArgumentException; const-string v0, "Failed requirement." invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v0 invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V throw p1 .end method .method public setIndex(I)V .locals 0 iput p1, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->index:I return-void .end method .method public final timeToExecute(J)Z .locals 2 iget-wide v0, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->nanoTime:J sub-long/2addr p1, v0 const-wide/16 v0, 0x0 cmp-long p1, p1, v0 if-ltz p1, :cond_0 const/4 p1, 0x1 goto :goto_0 :cond_0 const/4 p1, 0x0 :goto_0 return p1 .end method .method public toString()Ljava/lang/String; .locals 3 .line 486 new-instance v0, Ljava/lang/StringBuilder; invoke-direct {v0}, Ljava/lang/StringBuilder;->()V const-string v1, "Delayed[nanos=" invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; iget-wide v1, p0, Lkotlinx/coroutines/EventLoopImplBase$DelayedTask;->nanoTime:J invoke-virtual {v0, v1, v2}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder; const/16 v1, 0x5d invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder; invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v0 return-object v0 .end method