.class public final Lokhttp3/Dispatcher; .super Ljava/lang/Object; .source "Dispatcher.kt" # annotations .annotation system Ldalvik/annotation/SourceDebugExtension; value = "SMAP\nDispatcher.kt\nKotlin\n*S Kotlin\n*F\n+ 1 Dispatcher.kt\nokhttp3/Dispatcher\n+ 2 fake.kt\nkotlin/jvm/internal/FakeKt\n+ 3 Util.kt\nokhttp3/internal/Util\n+ 4 _Collections.kt\nkotlin/collections/CollectionsKt___CollectionsKt\n*L\n1#1,241:1\n1#2:242\n608#3,4:243\n1497#4:247\n1568#4,3:248\n1497#4:251\n1568#4,3:252\n*E\n*S KotlinDebug\n*F\n+ 1 Dispatcher.kt\nokhttp3/Dispatcher\n*L\n162#1,4:243\n222#1:247\n222#1,3:248\n227#1:251\n227#1,3:252\n*E\n" .end annotation .annotation runtime Lkotlin/Metadata; bv = { 0x1, 0x0, 0x3 } d1 = { "\u0000\\\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0005\n\u0002\u0018\u0002\n\u0002\u0008\u0006\n\u0002\u0010\u0008\n\u0002\u0008\u0008\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0003\n\u0002\u0010\u0002\n\u0002\u0008\u0008\n\u0002\u0010\u000e\n\u0002\u0008\u0003\n\u0002\u0018\u0002\n\u0002\u0008\u0003\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\u0008\u0004\u0018\u00002\u00020\u0001B\u000f\u0008\u0016\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u00a2\u0006\u0002\u0010\u0004B\u0005\u00a2\u0006\u0002\u0010\u0005J\u0006\u0010\u001e\u001a\u00020\u001fJ\u0019\u0010 \u001a\u00020\u001f2\n\u0010!\u001a\u00060\u001aR\u00020\u001bH\u0000\u00a2\u0006\u0002\u0008\"J\u0015\u0010#\u001a\u00020\u001f2\u0006\u0010!\u001a\u00020\u001bH\u0000\u00a2\u0006\u0002\u0008$J\r\u0010\u0002\u001a\u00020\u0003H\u0007\u00a2\u0006\u0002\u0008%J\u0016\u0010&\u001a\u0008\u0018\u00010\u001aR\u00020\u001b2\u0006\u0010\'\u001a\u00020(H\u0002J)\u0010)\u001a\u00020\u001f\"\u0004\u0008\u0000\u0010*2\u000c\u0010+\u001a\u0008\u0012\u0004\u0012\u0002H*0,2\u0006\u0010!\u001a\u0002H*H\u0002\u00a2\u0006\u0002\u0010-J\u0015\u0010)\u001a\u00020\u001f2\u0006\u0010!\u001a\u00020\u001bH\u0000\u00a2\u0006\u0002\u0008.J\u0019\u0010)\u001a\u00020\u001f2\n\u0010!\u001a\u00060\u001aR\u00020\u001bH\u0000\u00a2\u0006\u0002\u0008.J\u0008\u0010/\u001a\u000200H\u0002J\u000c\u00101\u001a\u0008\u0012\u0004\u0012\u00020302J\u0006\u00104\u001a\u00020\u0010J\u000c\u00105\u001a\u0008\u0012\u0004\u0012\u00020302J\u0006\u00106\u001a\u00020\u0010R\u0011\u0010\u0002\u001a\u00020\u00038G\u00a2\u0006\u0006\u001a\u0004\u0008\u0002\u0010\u0006R\u0010\u0010\u0007\u001a\u0004\u0018\u00010\u0003X\u0082\u000e\u00a2\u0006\u0002\n\u0000R*\u0010\n\u001a\u0004\u0018\u00010\t2\u0008\u0010\u0008\u001a\u0004\u0018\u00010\t8F@FX\u0086\u000e\u00a2\u0006\u000e\n\u0000\u001a\u0004\u0008\u000b\u0010\u000c\"\u0004\u0008\r\u0010\u000eR&\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u000f\u001a\u00020\u00108F@FX\u0086\u000e\u00a2\u0006\u000e\n\u0000\u001a\u0004\u0008\u0011\u0010\u0012\"\u0004\u0008\u0013\u0010\u0014R&\u0010\u0015\u001a\u00020\u00102\u0006\u0010\u0015\u001a\u00020\u00108F@FX\u0086\u000e\u00a2\u0006\u000e\n\u0000\u001a\u0004\u0008\u0016\u0010\u0012\"\u0004\u0008\u0017\u0010\u0014R\u0018\u0010\u0018\u001a\u000c\u0012\u0008\u0012\u00060\u001aR\u00020\u001b0\u0019X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0018\u0010\u001c\u001a\u000c\u0012\u0008\u0012\u00060\u001aR\u00020\u001b0\u0019X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u001d\u001a\u0008\u0012\u0004\u0012\u00020\u001b0\u0019X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u00067" } d2 = { "Lokhttp3/Dispatcher;", "", "executorService", "Ljava/util/concurrent/ExecutorService;", "(Ljava/util/concurrent/ExecutorService;)V", "()V", "()Ljava/util/concurrent/ExecutorService;", "executorServiceOrNull", "", "Ljava/lang/Runnable;", "idleCallback", "getIdleCallback", "()Ljava/lang/Runnable;", "setIdleCallback", "(Ljava/lang/Runnable;)V", "maxRequests", "", "getMaxRequests", "()I", "setMaxRequests", "(I)V", "maxRequestsPerHost", "getMaxRequestsPerHost", "setMaxRequestsPerHost", "readyAsyncCalls", "Ljava/util/ArrayDeque;", "Lokhttp3/internal/connection/RealCall$AsyncCall;", "Lokhttp3/internal/connection/RealCall;", "runningAsyncCalls", "runningSyncCalls", "cancelAll", "", "enqueue", "call", "enqueue$okhttp", "executed", "executed$okhttp", "-deprecated_executorService", "findExistingCallWithHost", "host", "", "finished", "T", "calls", "Ljava/util/Deque;", "(Ljava/util/Deque;Ljava/lang/Object;)V", "finished$okhttp", "promoteAndExecute", "", "queuedCalls", "", "Lokhttp3/Call;", "queuedCallsCount", "runningCalls", "runningCallsCount", "okhttp" } k = 0x1 mv = { 0x1, 0x4, 0x0 } .end annotation # instance fields .field private executorServiceOrNull:Ljava/util/concurrent/ExecutorService; .field private idleCallback:Ljava/lang/Runnable; .field private maxRequests:I .field private maxRequestsPerHost:I .field private final readyAsyncCalls:Ljava/util/ArrayDeque; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/ArrayDeque<", "Lokhttp3/internal/connection/RealCall$AsyncCall;", ">;" } .end annotation .end field .field private final runningAsyncCalls:Ljava/util/ArrayDeque; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/ArrayDeque<", "Lokhttp3/internal/connection/RealCall$AsyncCall;", ">;" } .end annotation .end field .field private final runningSyncCalls:Ljava/util/ArrayDeque; .annotation system Ldalvik/annotation/Signature; value = { "Ljava/util/ArrayDeque<", "Lokhttp3/internal/connection/RealCall;", ">;" } .end annotation .end field # direct methods .method public constructor ()V .locals 1 .line 38 invoke-direct {p0}, Ljava/lang/Object;->()V const/16 v0, 0x40 iput v0, p0, Lokhttp3/Dispatcher;->maxRequests:I const/4 v0, 0x5 iput v0, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I .line 102 new-instance v0, Ljava/util/ArrayDeque; invoke-direct {v0}, Ljava/util/ArrayDeque;->()V iput-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/ArrayDeque; .line 105 new-instance v0, Ljava/util/ArrayDeque; invoke-direct {v0}, Ljava/util/ArrayDeque;->()V iput-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/ArrayDeque; .line 108 new-instance v0, Ljava/util/ArrayDeque; invoke-direct {v0}, Ljava/util/ArrayDeque;->()V iput-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/ArrayDeque; return-void .end method .method public constructor (Ljava/util/concurrent/ExecutorService;)V .locals 1 const-string v0, "executorService" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 110 invoke-direct {p0}, Lokhttp3/Dispatcher;->()V iput-object p1, p0, Lokhttp3/Dispatcher;->executorServiceOrNull:Ljava/util/concurrent/ExecutorService; return-void .end method .method private final findExistingCallWithHost(Ljava/lang/String;)Lokhttp3/internal/connection/RealCall$AsyncCall; .locals 3 iget-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/ArrayDeque; .line 129 invoke-virtual {v0}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator; move-result-object v0 :cond_0 invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z move-result v1 if-eqz v1, :cond_1 invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 check-cast v1, Lokhttp3/internal/connection/RealCall$AsyncCall; .line 130 invoke-virtual {v1}, Lokhttp3/internal/connection/RealCall$AsyncCall;->getHost()Ljava/lang/String; move-result-object v2 invoke-static {v2, p1}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v2 if-eqz v2, :cond_0 return-object v1 :cond_1 iget-object p0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/ArrayDeque; .line 132 invoke-virtual {p0}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator; move-result-object p0 :cond_2 invoke-interface {p0}, Ljava/util/Iterator;->hasNext()Z move-result v0 if-eqz v0, :cond_3 invoke-interface {p0}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v0 check-cast v0, Lokhttp3/internal/connection/RealCall$AsyncCall; .line 133 invoke-virtual {v0}, Lokhttp3/internal/connection/RealCall$AsyncCall;->getHost()Ljava/lang/String; move-result-object v1 invoke-static {v1, p1}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z move-result v1 if-eqz v1, :cond_2 return-object v0 :cond_3 const/4 p0, 0x0 return-object p0 .end method .method private final finished(Ljava/util/Deque;Ljava/lang/Object;)V .locals 0 .annotation system Ldalvik/annotation/Signature; value = { "(", "Ljava/util/Deque<", "TT;>;TT;)V" } .end annotation .line 208 monitor-enter p0 .line 209 :try_start_0 invoke-interface {p1, p2}, Ljava/util/Deque;->remove(Ljava/lang/Object;)Z move-result p1 if-eqz p1, :cond_1 iget-object p1, p0, Lokhttp3/Dispatcher;->idleCallback:Ljava/lang/Runnable; .line 211 sget-object p2, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 208 monitor-exit p0 .line 213 invoke-direct {p0}, Lokhttp3/Dispatcher;->promoteAndExecute()Z move-result p0 if-nez p0, :cond_0 if-eqz p1, :cond_0 .line 216 invoke-interface {p1}, Ljava/lang/Runnable;->run()V :cond_0 return-void .line 209 :cond_1 :try_start_1 new-instance p1, Ljava/lang/AssertionError; const-string p2, "Call wasn\'t in-flight!" invoke-direct {p1, p2}, Ljava/lang/AssertionError;->(Ljava/lang/Object;)V check-cast p1, Ljava/lang/Throwable; throw p1 :try_end_1 .catchall {:try_start_1 .. :try_end_1} :catchall_0 :catchall_0 move-exception p1 .line 208 monitor-exit p0 throw p1 .end method .method private final promoteAndExecute()Z .locals 6 .line 243 sget-boolean v0, Lokhttp3/internal/Util;->assertionsEnabled:Z if-eqz v0, :cond_1 invoke-static {p0}, Ljava/lang/Thread;->holdsLock(Ljava/lang/Object;)Z move-result v0 if-nez v0, :cond_0 goto :goto_0 .line 244 :cond_0 new-instance v0, Ljava/lang/AssertionError; new-instance v1, Ljava/lang/StringBuilder; const-string v2, "Thread " invoke-direct {v1, v2}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread; move-result-object v2 const-string v3, "Thread.currentThread()" invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V invoke-virtual {v2}, Ljava/lang/Thread;->getName()Ljava/lang/String; move-result-object v2 invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 const-string v2, " MUST NOT hold lock on " invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 invoke-direct {v0, p0}, Ljava/lang/AssertionError;->(Ljava/lang/Object;)V check-cast v0, Ljava/lang/Throwable; throw v0 .line 164 :cond_1 :goto_0 new-instance v0, Ljava/util/ArrayList; invoke-direct {v0}, Ljava/util/ArrayList;->()V check-cast v0, Ljava/util/List; .line 166 monitor-enter p0 :try_start_0 iget-object v1, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/ArrayDeque; .line 167 invoke-virtual {v1}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator; move-result-object v1 const-string v2, "readyAsyncCalls.iterator()" invoke-static {v1, v2}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V .line 168 :goto_1 invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z move-result v2 if-eqz v2, :cond_4 .line 169 invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v2 check-cast v2, Lokhttp3/internal/connection/RealCall$AsyncCall; iget-object v3, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/ArrayDeque; .line 171 invoke-virtual {v3}, Ljava/util/ArrayDeque;->size()I move-result v3 iget v4, p0, Lokhttp3/Dispatcher;->maxRequests:I if-lt v3, v4, :cond_2 goto :goto_2 .line 172 :cond_2 invoke-virtual {v2}, Lokhttp3/internal/connection/RealCall$AsyncCall;->getCallsPerHost()Ljava/util/concurrent/atomic/AtomicInteger; move-result-object v3 invoke-virtual {v3}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I move-result v3 iget v4, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I if-lt v3, v4, :cond_3 goto :goto_1 .line 174 :cond_3 invoke-interface {v1}, Ljava/util/Iterator;->remove()V .line 175 invoke-virtual {v2}, Lokhttp3/internal/connection/RealCall$AsyncCall;->getCallsPerHost()Ljava/util/concurrent/atomic/AtomicInteger; move-result-object v3 invoke-virtual {v3}, Ljava/util/concurrent/atomic/AtomicInteger;->incrementAndGet()I const-string v3, "asyncCall" .line 176 invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z iget-object v3, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/ArrayDeque; .line 177 invoke-virtual {v3, v2}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z goto :goto_1 .line 179 :cond_4 :goto_2 invoke-virtual {p0}, Lokhttp3/Dispatcher;->runningCallsCount()I move-result v1 const/4 v2, 0x0 if-lez v1, :cond_5 const/4 v1, 0x1 goto :goto_3 :cond_5 move v1, v2 .line 180 :goto_3 sget-object v3, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 166 monitor-exit p0 .line 182 invoke-interface {v0}, Ljava/util/List;->size()I move-result v3 :goto_4 if-ge v2, v3, :cond_6 .line 183 invoke-interface {v0, v2}, Ljava/util/List;->get(I)Ljava/lang/Object; move-result-object v4 check-cast v4, Lokhttp3/internal/connection/RealCall$AsyncCall; .line 184 invoke-virtual {p0}, Lokhttp3/Dispatcher;->executorService()Ljava/util/concurrent/ExecutorService; move-result-object v5 invoke-virtual {v4, v5}, Lokhttp3/internal/connection/RealCall$AsyncCall;->executeOn(Ljava/util/concurrent/ExecutorService;)V add-int/lit8 v2, v2, 0x1 goto :goto_4 :cond_6 return v1 :catchall_0 move-exception v0 .line 166 monitor-exit p0 throw v0 .end method # virtual methods .method public final -deprecated_executorService()Ljava/util/concurrent/ExecutorService; .locals 0 .annotation runtime Lkotlin/Deprecated; level = .enum Lkotlin/DeprecationLevel;->ERROR:Lkotlin/DeprecationLevel; message = "moved to val" replaceWith = .subannotation Lkotlin/ReplaceWith; expression = "executorService" imports = {} .end subannotation .end annotation .line 239 invoke-virtual {p0}, Lokhttp3/Dispatcher;->executorService()Ljava/util/concurrent/ExecutorService; move-result-object p0 return-object p0 .end method .method public final declared-synchronized cancelAll()V .locals 2 monitor-enter p0 :try_start_0 iget-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/ArrayDeque; .line 143 invoke-virtual {v0}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator; move-result-object v0 :goto_0 invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z move-result v1 if-eqz v1, :cond_0 invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 check-cast v1, Lokhttp3/internal/connection/RealCall$AsyncCall; .line 144 invoke-virtual {v1}, Lokhttp3/internal/connection/RealCall$AsyncCall;->getCall()Lokhttp3/internal/connection/RealCall; move-result-object v1 invoke-virtual {v1}, Lokhttp3/internal/connection/RealCall;->cancel()V goto :goto_0 :cond_0 iget-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/ArrayDeque; .line 146 invoke-virtual {v0}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator; move-result-object v0 :goto_1 invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z move-result v1 if-eqz v1, :cond_1 invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 check-cast v1, Lokhttp3/internal/connection/RealCall$AsyncCall; .line 147 invoke-virtual {v1}, Lokhttp3/internal/connection/RealCall$AsyncCall;->getCall()Lokhttp3/internal/connection/RealCall; move-result-object v1 invoke-virtual {v1}, Lokhttp3/internal/connection/RealCall;->cancel()V goto :goto_1 :cond_1 iget-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/ArrayDeque; .line 149 invoke-virtual {v0}, Ljava/util/ArrayDeque;->iterator()Ljava/util/Iterator; move-result-object v0 :goto_2 invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z move-result v1 if-eqz v1, :cond_2 invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v1 check-cast v1, Lokhttp3/internal/connection/RealCall; .line 150 invoke-virtual {v1}, Lokhttp3/internal/connection/RealCall;->cancel()V :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 goto :goto_2 .line 152 :cond_2 monitor-exit p0 return-void :catchall_0 move-exception v0 monitor-exit p0 throw v0 .end method .method public final enqueue$okhttp(Lokhttp3/internal/connection/RealCall$AsyncCall;)V .locals 1 const-string v0, "call" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 115 monitor-enter p0 :try_start_0 iget-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/ArrayDeque; .line 116 invoke-virtual {v0, p1}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z .line 120 invoke-virtual {p1}, Lokhttp3/internal/connection/RealCall$AsyncCall;->getCall()Lokhttp3/internal/connection/RealCall; move-result-object v0 invoke-virtual {v0}, Lokhttp3/internal/connection/RealCall;->getForWebSocket()Z move-result v0 if-nez v0, :cond_0 .line 121 invoke-virtual {p1}, Lokhttp3/internal/connection/RealCall$AsyncCall;->getHost()Ljava/lang/String; move-result-object v0 invoke-direct {p0, v0}, Lokhttp3/Dispatcher;->findExistingCallWithHost(Ljava/lang/String;)Lokhttp3/internal/connection/RealCall$AsyncCall; move-result-object v0 if-eqz v0, :cond_0 .line 122 invoke-virtual {p1, v0}, Lokhttp3/internal/connection/RealCall$AsyncCall;->reuseCallsPerHostFrom(Lokhttp3/internal/connection/RealCall$AsyncCall;)V .line 124 :cond_0 sget-object p1, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 115 monitor-exit p0 .line 125 invoke-direct {p0}, Lokhttp3/Dispatcher;->promoteAndExecute()Z return-void :catchall_0 move-exception p1 .line 115 monitor-exit p0 throw p1 .end method .method public final declared-synchronized executed$okhttp(Lokhttp3/internal/connection/RealCall;)V .locals 1 monitor-enter p0 :try_start_0 const-string v0, "call" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V iget-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/ArrayDeque; .line 192 invoke-virtual {v0, p1}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 193 monitor-exit p0 return-void :catchall_0 move-exception p1 monitor-exit p0 throw p1 .end method .method public final declared-synchronized executorService()Ljava/util/concurrent/ExecutorService; .locals 9 monitor-enter p0 :try_start_0 iget-object v0, p0, Lokhttp3/Dispatcher;->executorServiceOrNull:Ljava/util/concurrent/ExecutorService; if-nez v0, :cond_0 .line 95 new-instance v0, Ljava/util/concurrent/ThreadPoolExecutor; const/4 v2, 0x0 const v3, 0x7fffffff const-wide/16 v4, 0x3c sget-object v6, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit; .line 96 new-instance v1, Ljava/util/concurrent/SynchronousQueue; invoke-direct {v1}, Ljava/util/concurrent/SynchronousQueue;->()V move-object v7, v1 check-cast v7, Ljava/util/concurrent/BlockingQueue; new-instance v1, Ljava/lang/StringBuilder; invoke-direct {v1}, Ljava/lang/StringBuilder;->()V sget-object v8, Lokhttp3/internal/Util;->okHttpName:Ljava/lang/String; invoke-virtual {v1, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 const-string v8, " Dispatcher" invoke-virtual {v1, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder; move-result-object v1 invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object v1 const/4 v8, 0x0 invoke-static {v1, v8}, Lokhttp3/internal/Util;->threadFactory(Ljava/lang/String;Z)Ljava/util/concurrent/ThreadFactory; move-result-object v8 move-object v1, v0 .line 95 invoke-direct/range {v1 .. v8}, Ljava/util/concurrent/ThreadPoolExecutor;->(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V check-cast v0, Ljava/util/concurrent/ExecutorService; iput-object v0, p0, Lokhttp3/Dispatcher;->executorServiceOrNull:Ljava/util/concurrent/ExecutorService; :cond_0 iget-object v0, p0, Lokhttp3/Dispatcher;->executorServiceOrNull:Ljava/util/concurrent/ExecutorService; .line 98 invoke-static {v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 monitor-exit p0 return-object v0 :catchall_0 move-exception v0 monitor-exit p0 throw v0 .end method .method public final finished$okhttp(Lokhttp3/internal/connection/RealCall$AsyncCall;)V .locals 1 const-string v0, "call" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 197 invoke-virtual {p1}, Lokhttp3/internal/connection/RealCall$AsyncCall;->getCallsPerHost()Ljava/util/concurrent/atomic/AtomicInteger; move-result-object v0 invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->decrementAndGet()I iget-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/ArrayDeque; .line 198 check-cast v0, Ljava/util/Deque; invoke-direct {p0, v0, p1}, Lokhttp3/Dispatcher;->finished(Ljava/util/Deque;Ljava/lang/Object;)V return-void .end method .method public final finished$okhttp(Lokhttp3/internal/connection/RealCall;)V .locals 1 const-string v0, "call" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V iget-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/ArrayDeque; .line 203 check-cast v0, Ljava/util/Deque; invoke-direct {p0, v0, p1}, Lokhttp3/Dispatcher;->finished(Ljava/util/Deque;Ljava/lang/Object;)V return-void .end method .method public final declared-synchronized getIdleCallback()Ljava/lang/Runnable; .locals 1 monitor-enter p0 :try_start_0 iget-object v0, p0, Lokhttp3/Dispatcher;->idleCallback:Ljava/lang/Runnable; :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 87 monitor-exit p0 return-object v0 :catchall_0 move-exception v0 monitor-exit p0 throw v0 .end method .method public final declared-synchronized getMaxRequests()I .locals 1 monitor-enter p0 :try_start_0 iget v0, p0, Lokhttp3/Dispatcher;->maxRequests:I :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 46 monitor-exit p0 return v0 :catchall_0 move-exception v0 monitor-exit p0 throw v0 .end method .method public final declared-synchronized getMaxRequestsPerHost()I .locals 1 monitor-enter p0 :try_start_0 iget v0, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 65 monitor-exit p0 return v0 :catchall_0 move-exception v0 monitor-exit p0 throw v0 .end method .method public final declared-synchronized queuedCalls()Ljava/util/List; .locals 3 .annotation system Ldalvik/annotation/Signature; value = { "()", "Ljava/util/List<", "Lokhttp3/Call;", ">;" } .end annotation monitor-enter p0 :try_start_0 iget-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/ArrayDeque; .line 222 check-cast v0, Ljava/lang/Iterable; .line 247 new-instance v1, Ljava/util/ArrayList; const/16 v2, 0xa invoke-static {v0, v2}, Lkotlin/collections/CollectionsKt;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I move-result v2 invoke-direct {v1, v2}, Ljava/util/ArrayList;->(I)V check-cast v1, Ljava/util/Collection; .line 248 invoke-interface {v0}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator; move-result-object v0 :goto_0 invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z move-result v2 if-eqz v2, :cond_0 invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v2 .line 249 check-cast v2, Lokhttp3/internal/connection/RealCall$AsyncCall; .line 222 invoke-virtual {v2}, Lokhttp3/internal/connection/RealCall$AsyncCall;->getCall()Lokhttp3/internal/connection/RealCall; move-result-object v2 invoke-interface {v1, v2}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z goto :goto_0 .line 250 :cond_0 check-cast v1, Ljava/util/List; .line 222 invoke-static {v1}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List; move-result-object v0 const-string v1, "Collections.unmodifiable\u2026yncCalls.map { it.call })" invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 monitor-exit p0 return-object v0 :catchall_0 move-exception v0 monitor-exit p0 throw v0 .end method .method public final declared-synchronized queuedCallsCount()I .locals 1 monitor-enter p0 :try_start_0 iget-object v0, p0, Lokhttp3/Dispatcher;->readyAsyncCalls:Ljava/util/ArrayDeque; .line 230 invoke-virtual {v0}, Ljava/util/ArrayDeque;->size()I move-result v0 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 monitor-exit p0 return v0 :catchall_0 move-exception v0 monitor-exit p0 throw v0 .end method .method public final declared-synchronized runningCalls()Ljava/util/List; .locals 4 .annotation system Ldalvik/annotation/Signature; value = { "()", "Ljava/util/List<", "Lokhttp3/Call;", ">;" } .end annotation monitor-enter p0 :try_start_0 iget-object v0, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/ArrayDeque; .line 227 check-cast v0, Ljava/util/Collection; iget-object v1, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/ArrayDeque; check-cast v1, Ljava/lang/Iterable; .line 251 new-instance v2, Ljava/util/ArrayList; const/16 v3, 0xa invoke-static {v1, v3}, Lkotlin/collections/CollectionsKt;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I move-result v3 invoke-direct {v2, v3}, Ljava/util/ArrayList;->(I)V check-cast v2, Ljava/util/Collection; .line 252 invoke-interface {v1}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator; move-result-object v1 :goto_0 invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z move-result v3 if-eqz v3, :cond_0 invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object; move-result-object v3 .line 253 check-cast v3, Lokhttp3/internal/connection/RealCall$AsyncCall; .line 227 invoke-virtual {v3}, Lokhttp3/internal/connection/RealCall$AsyncCall;->getCall()Lokhttp3/internal/connection/RealCall; move-result-object v3 invoke-interface {v2, v3}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z goto :goto_0 .line 254 :cond_0 check-cast v2, Ljava/util/List; .line 251 check-cast v2, Ljava/lang/Iterable; .line 227 invoke-static {v0, v2}, Lkotlin/collections/CollectionsKt;->plus(Ljava/util/Collection;Ljava/lang/Iterable;)Ljava/util/List; move-result-object v0 invoke-static {v0}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List; move-result-object v0 const-string v1, "Collections.unmodifiable\u2026yncCalls.map { it.call })" invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 monitor-exit p0 return-object v0 :catchall_0 move-exception v0 monitor-exit p0 throw v0 .end method .method public final declared-synchronized runningCallsCount()I .locals 2 monitor-enter p0 :try_start_0 iget-object v0, p0, Lokhttp3/Dispatcher;->runningAsyncCalls:Ljava/util/ArrayDeque; .line 232 invoke-virtual {v0}, Ljava/util/ArrayDeque;->size()I move-result v0 iget-object v1, p0, Lokhttp3/Dispatcher;->runningSyncCalls:Ljava/util/ArrayDeque; invoke-virtual {v1}, Ljava/util/ArrayDeque;->size()I move-result v1 :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 add-int/2addr v0, v1 monitor-exit p0 return v0 :catchall_0 move-exception v0 monitor-exit p0 throw v0 .end method .method public final declared-synchronized setIdleCallback(Ljava/lang/Runnable;)V .locals 0 monitor-enter p0 :try_start_0 iput-object p1, p0, Lokhttp3/Dispatcher;->idleCallback:Ljava/lang/Runnable; :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 87 monitor-exit p0 return-void :catchall_0 move-exception p1 monitor-exit p0 throw p1 .end method .method public final setMaxRequests(I)V .locals 1 const/4 v0, 0x1 if-lt p1, v0, :cond_0 goto :goto_0 :cond_0 const/4 v0, 0x0 :goto_0 if-eqz v0, :cond_1 .line 49 monitor-enter p0 :try_start_0 iput p1, p0, Lokhttp3/Dispatcher;->maxRequests:I .line 51 sget-object p1, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 49 monitor-exit p0 .line 52 invoke-direct {p0}, Lokhttp3/Dispatcher;->promoteAndExecute()Z return-void :catchall_0 move-exception p1 .line 49 monitor-exit p0 throw p1 .line 48 :cond_1 new-instance p0, Ljava/lang/StringBuilder; const-string v0, "max < 1: " invoke-direct {p0, v0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 new-instance p1, Ljava/lang/IllegalArgumentException; invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p0 invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V check-cast p1, Ljava/lang/Throwable; throw p1 .end method .method public final setMaxRequestsPerHost(I)V .locals 1 const/4 v0, 0x1 if-lt p1, v0, :cond_0 goto :goto_0 :cond_0 const/4 v0, 0x0 :goto_0 if-eqz v0, :cond_1 .line 68 monitor-enter p0 :try_start_0 iput p1, p0, Lokhttp3/Dispatcher;->maxRequestsPerHost:I .line 70 sget-object p1, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; :try_end_0 .catchall {:try_start_0 .. :try_end_0} :catchall_0 .line 68 monitor-exit p0 .line 71 invoke-direct {p0}, Lokhttp3/Dispatcher;->promoteAndExecute()Z return-void :catchall_0 move-exception p1 .line 68 monitor-exit p0 throw p1 .line 67 :cond_1 new-instance p0, Ljava/lang/StringBuilder; const-string v0, "max < 1: " invoke-direct {p0, v0}, Ljava/lang/StringBuilder;->(Ljava/lang/String;)V invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder; move-result-object p0 invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String; move-result-object p0 new-instance p1, Ljava/lang/IllegalArgumentException; invoke-virtual {p0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p0 invoke-direct {p1, p0}, Ljava/lang/IllegalArgumentException;->(Ljava/lang/String;)V check-cast p1, Ljava/lang/Throwable; throw p1 .end method