2019-02-04 20:08:30 +00:00
|
|
|
.class public Lcom/facebook/common/b/b;
|
|
|
|
.super Ljava/util/concurrent/AbstractExecutorService;
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
|
|
|
Lcom/facebook/common/b/b$a;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
|
|
|
.field private static final Bp:Ljava/lang/Class;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/lang/Class<",
|
|
|
|
"*>;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field private final CA:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
|
|
|
|
.field private volatile Cw:I
|
|
|
|
|
|
|
|
.field private final Cx:Ljava/util/concurrent/BlockingQueue;
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"Ljava/util/concurrent/BlockingQueue<",
|
|
|
|
"Ljava/lang/Runnable;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
.end field
|
|
|
|
|
|
|
|
.field private final Cy:Lcom/facebook/common/b/b$a;
|
|
|
|
|
|
|
|
.field private final Cz:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
|
|
|
|
.field private final mExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
|
|
|
|
.field private final mName:Ljava/lang/String;
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method static constructor <clinit>()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
const-class v0, Lcom/facebook/common/b/b;
|
|
|
|
|
|
|
|
sput-object v0, Lcom/facebook/common/b/b;->Bp:Ljava/lang/Class;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public constructor <init>(Ljava/lang/String;Ljava/util/concurrent/Executor;Ljava/util/concurrent/BlockingQueue;)V
|
|
|
|
.locals 0
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"(",
|
|
|
|
"Ljava/lang/String;",
|
|
|
|
"Ljava/util/concurrent/Executor;",
|
|
|
|
"Ljava/util/concurrent/BlockingQueue<",
|
|
|
|
"Ljava/lang/Runnable;",
|
|
|
|
">;)V"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
invoke-direct {p0}, Ljava/util/concurrent/AbstractExecutorService;-><init>()V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/facebook/common/b/b;->mName:Ljava/lang/String;
|
|
|
|
|
|
|
|
iput-object p2, p0, Lcom/facebook/common/b/b;->mExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
|
|
|
|
const/4 p1, 0x1
|
|
|
|
|
|
|
|
iput p1, p0, Lcom/facebook/common/b/b;->Cw:I
|
|
|
|
|
|
|
|
iput-object p3, p0, Lcom/facebook/common/b/b;->Cx:Ljava/util/concurrent/BlockingQueue;
|
|
|
|
|
|
|
|
new-instance p1, Lcom/facebook/common/b/b$a;
|
|
|
|
|
|
|
|
const/4 p2, 0x0
|
|
|
|
|
|
|
|
invoke-direct {p1, p0, p2}, Lcom/facebook/common/b/b$a;-><init>(Lcom/facebook/common/b/b;B)V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/facebook/common/b/b;->Cy:Lcom/facebook/common/b/b$a;
|
|
|
|
|
|
|
|
new-instance p1, Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
|
|
|
|
invoke-direct {p1, p2}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>(I)V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/facebook/common/b/b;->Cz:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
|
|
|
|
new-instance p1, Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
|
|
|
|
invoke-direct {p1, p2}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>(I)V
|
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/facebook/common/b/b;->CA:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method static synthetic a(Lcom/facebook/common/b/b;)Ljava/util/concurrent/BlockingQueue;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lcom/facebook/common/b/b;->Cx:Ljava/util/concurrent/BlockingQueue;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method static synthetic b(Lcom/facebook/common/b/b;)Ljava/lang/String;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lcom/facebook/common/b/b;->mName:Ljava/lang/String;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method static synthetic c(Lcom/facebook/common/b/b;)Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
iget-object p0, p0, Lcom/facebook/common/b/b;->Cz:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
|
|
|
|
return-object p0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method static synthetic d(Lcom/facebook/common/b/b;)V
|
|
|
|
.locals 0
|
|
|
|
|
2019-02-04 20:17:36 +00:00
|
|
|
invoke-direct {p0}, Lcom/facebook/common/b/b;->fe()V
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2019-02-04 20:17:36 +00:00
|
|
|
.method private fe()V
|
2019-02-04 20:08:30 +00:00
|
|
|
.locals 5
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
iget-object v0, p0, Lcom/facebook/common/b/b;->Cz:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
iget v1, p0, Lcom/facebook/common/b/b;->Cw:I
|
|
|
|
|
|
|
|
if-ge v0, v1, :cond_1
|
|
|
|
|
|
|
|
add-int/lit8 v1, v0, 0x1
|
|
|
|
|
|
|
|
iget-object v2, p0, Lcom/facebook/common/b/b;->Cz:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
|
|
|
|
invoke-virtual {v2, v0, v1}, Ljava/util/concurrent/atomic/AtomicInteger;->compareAndSet(II)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
sget-object v0, Lcom/facebook/common/b/b;->Bp:Ljava/lang/Class;
|
|
|
|
|
|
|
|
const-string v2, "%s: starting worker %d of %d"
|
|
|
|
|
|
|
|
iget-object v3, p0, Lcom/facebook/common/b/b;->mName:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
iget v4, p0, Lcom/facebook/common/b/b;->Cw:I
|
|
|
|
|
|
|
|
invoke-static {v4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object v4
|
|
|
|
|
|
|
|
invoke-static {v0, v2, v3, v1, v4}, Lcom/facebook/common/e/a;->a(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/facebook/common/b/b;->mExecutor:Ljava/util/concurrent/Executor;
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/facebook/common/b/b;->Cy:Lcom/facebook/common/b/b$a;
|
|
|
|
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
sget-object v0, Lcom/facebook/common/b/b;->Bp:Ljava/lang/Class;
|
|
|
|
|
|
|
|
const-string v1, "%s: race in startWorkerIfNeeded; retrying"
|
|
|
|
|
|
|
|
iget-object v2, p0, Lcom/facebook/common/b/b;->mName:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-static {v0, v1, v2}, Lcom/facebook/common/e/a;->a(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
2019-02-04 20:17:36 +00:00
|
|
|
.method static synthetic ff()Ljava/lang/Class;
|
2019-02-04 20:08:30 +00:00
|
|
|
.locals 1
|
|
|
|
|
|
|
|
sget-object v0, Lcom/facebook/common/b/b;->Bp:Ljava/lang/Class;
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public awaitTermination(JLjava/util/concurrent/TimeUnit;)Z
|
|
|
|
.locals 0
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
|
|
value = {
|
|
|
|
Ljava/lang/InterruptedException;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
new-instance p1, Ljava/lang/UnsupportedOperationException;
|
|
|
|
|
|
|
|
invoke-direct {p1}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
|
|
|
|
throw p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public execute(Ljava/lang/Runnable;)V
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/facebook/common/b/b;->Cx:Ljava/util/concurrent/BlockingQueue;
|
|
|
|
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/concurrent/BlockingQueue;->offer(Ljava/lang/Object;)Z
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
|
|
|
|
iget-object p1, p0, Lcom/facebook/common/b/b;->Cx:Ljava/util/concurrent/BlockingQueue;
|
|
|
|
|
|
|
|
invoke-interface {p1}, Ljava/util/concurrent/BlockingQueue;->size()I
|
|
|
|
|
|
|
|
move-result p1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/facebook/common/b/b;->CA:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicInteger;->get()I
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-le p1, v0, :cond_0
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/facebook/common/b/b;->CA:Ljava/util/concurrent/atomic/AtomicInteger;
|
|
|
|
|
|
|
|
invoke-virtual {v1, v0, p1}, Ljava/util/concurrent/atomic/AtomicInteger;->compareAndSet(II)Z
|
|
|
|
|
|
|
|
move-result v0
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
sget-object v0, Lcom/facebook/common/b/b;->Bp:Ljava/lang/Class;
|
|
|
|
|
|
|
|
const-string v1, "%s: max pending work in queue = %d"
|
|
|
|
|
|
|
|
iget-object v2, p0, Lcom/facebook/common/b/b;->mName:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
invoke-static {v0, v1, v2, p1}, Lcom/facebook/common/e/a;->a(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
|
|
|
|
|
|
|
|
:cond_0
|
2019-02-04 20:17:36 +00:00
|
|
|
invoke-direct {p0}, Lcom/facebook/common/b/b;->fe()V
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
new-instance p1, Ljava/util/concurrent/RejectedExecutionException;
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/facebook/common/b/b;->mName:Ljava/lang/String;
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
const-string v1, " queue is full, size="
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
iget-object v1, p0, Lcom/facebook/common/b/b;->Cx:Ljava/util/concurrent/BlockingQueue;
|
|
|
|
|
|
|
|
invoke-interface {v1}, Ljava/util/concurrent/BlockingQueue;->size()I
|
|
|
|
|
|
|
|
move-result v1
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
invoke-direct {p1, v0}, Ljava/util/concurrent/RejectedExecutionException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw p1
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
new-instance p1, Ljava/lang/NullPointerException;
|
|
|
|
|
|
|
|
const-string v0, "runnable parameter is null"
|
|
|
|
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
|
|
|
|
|
|
|
|
throw p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public isShutdown()Z
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public isTerminated()Z
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
return v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public shutdown()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/UnsupportedOperationException;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public shutdownNow()Ljava/util/List;
|
|
|
|
.locals 1
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
|
|
value = {
|
|
|
|
"()",
|
|
|
|
"Ljava/util/List<",
|
|
|
|
"Ljava/lang/Runnable;",
|
|
|
|
">;"
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
new-instance v0, Ljava/lang/UnsupportedOperationException;
|
|
|
|
|
|
|
|
invoke-direct {v0}, Ljava/lang/UnsupportedOperationException;-><init>()V
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|