.class public final Lkotlinx/coroutines/DispatchedCoroutine; .super Lkotlinx/coroutines/internal/ScopeCoroutine; .source "SourceFile" # static fields .field public static final _decision$FU:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater; # instance fields .field private volatile _decision:I # direct methods .method static constructor ()V .locals 2 const-class v0, Lkotlinx/coroutines/DispatchedCoroutine; const-string v1, "_decision" invoke-static {v0, v1}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->newUpdater(Ljava/lang/Class;Ljava/lang/String;)Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater; move-result-object v0 sput-object v0, Lkotlinx/coroutines/DispatchedCoroutine;->_decision$FU:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater; return-void .end method .method public constructor (Lkotlin/coroutines/CoroutineContext;Lkotlin/coroutines/Continuation;)V .locals 0 .line 225 invoke-direct {p0, p1, p2}, Lkotlinx/coroutines/internal/ScopeCoroutine;->(Lkotlin/coroutines/CoroutineContext;Lkotlin/coroutines/Continuation;)V return-void .end method .method private final tryResume()Z .locals 5 sget-object v0, Lkotlinx/coroutines/DispatchedCoroutine;->_decision$FU:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater; :cond_0 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->get(Ljava/lang/Object;)I move-result v1 const/4 v2, 0x0 const/4 v3, 0x1 if-eqz v1, :cond_2 if-ne v1, v3, :cond_1 return v2 .line 246 :cond_1 new-instance v0, Ljava/lang/IllegalStateException; const-string v1, "Already resumed" .line 247 invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v1 invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw v0 :cond_2 sget-object v1, Lkotlinx/coroutines/DispatchedCoroutine;->_decision$FU:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater; const/4 v4, 0x2 .line 245 invoke-virtual {v1, p0, v2, v4}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->compareAndSet(Ljava/lang/Object;II)Z move-result v1 if-eqz v1, :cond_0 return v3 .end method .method private final trySuspend()Z .locals 4 sget-object v0, Lkotlinx/coroutines/DispatchedCoroutine;->_decision$FU:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater; :cond_0 invoke-virtual {v0, p0}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->get(Ljava/lang/Object;)I move-result v1 const/4 v2, 0x0 if-eqz v1, :cond_2 const/4 v0, 0x2 if-ne v1, v0, :cond_1 return v2 .line 236 :cond_1 new-instance v0, Ljava/lang/IllegalStateException; const-string v1, "Already suspended" .line 237 invoke-virtual {v1}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object v1 invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;->(Ljava/lang/String;)V throw v0 :cond_2 sget-object v1, Lkotlinx/coroutines/DispatchedCoroutine;->_decision$FU:Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater; const/4 v3, 0x1 .line 235 invoke-virtual {v1, p0, v2, v3}, Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater;->compareAndSet(Ljava/lang/Object;II)Z move-result v1 if-eqz v1, :cond_0 return v3 .end method # virtual methods .method public afterCompletion(Ljava/lang/Object;)V .locals 0 .line 255 invoke-virtual {p0, p1}, Lkotlinx/coroutines/DispatchedCoroutine;->afterResume(Ljava/lang/Object;)V return-void .end method .method public afterResume(Ljava/lang/Object;)V .locals 3 .line 259 invoke-direct {p0}, Lkotlinx/coroutines/DispatchedCoroutine;->tryResume()Z move-result v0 if-eqz v0, :cond_0 return-void :cond_0 iget-object v0, p0, Lkotlinx/coroutines/internal/ScopeCoroutine;->uCont:Lkotlin/coroutines/Continuation; .line 261 invoke-static {v0}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->intercepted(Lkotlin/coroutines/Continuation;)Lkotlin/coroutines/Continuation; move-result-object v0 iget-object v1, p0, Lkotlinx/coroutines/internal/ScopeCoroutine;->uCont:Lkotlin/coroutines/Continuation; invoke-static {p1, v1}, Lkotlinx/coroutines/CompletionStateKt;->recoverResult(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; move-result-object p1 const/4 v1, 0x2 const/4 v2, 0x0 invoke-static {v0, p1, v2, v1, v2}, Lkotlinx/coroutines/internal/DispatchedContinuationKt;->resumeCancellableWith$default(Lkotlin/coroutines/Continuation;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V return-void .end method .method public final getResult$kotlinx_coroutines_core()Ljava/lang/Object; .locals 2 .line 265 invoke-direct {p0}, Lkotlinx/coroutines/DispatchedCoroutine;->trySuspend()Z move-result v0 if-eqz v0, :cond_0 invoke-static {}, Lkotlin/coroutines/intrinsics/IntrinsicsKt;->getCOROUTINE_SUSPENDED()Ljava/lang/Object; move-result-object v0 return-object v0 .line 267 :cond_0 invoke-virtual {p0}, Lkotlinx/coroutines/JobSupport;->getState$kotlinx_coroutines_core()Ljava/lang/Object; move-result-object v0 invoke-static {v0}, Lkotlinx/coroutines/JobSupportKt;->unboxState(Ljava/lang/Object;)Ljava/lang/Object; move-result-object v0 .line 268 instance-of v1, v0, Lkotlinx/coroutines/CompletedExceptionally; if-nez v1, :cond_1 return-object v0 :cond_1 check-cast v0, Lkotlinx/coroutines/CompletedExceptionally; iget-object v0, v0, Lkotlinx/coroutines/CompletedExceptionally;->cause:Ljava/lang/Throwable; throw v0 .end method