You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
176 lines
5.0 KiB
176 lines
5.0 KiB
.class public Lcom/viatech/util/ThreadManager$ThreadPoolProxy; |
|
.super Ljava/lang/Object; |
|
.source "ThreadManager.java" |
|
|
|
|
|
# annotations |
|
.annotation system Ldalvik/annotation/EnclosingClass; |
|
value = Lcom/viatech/util/ThreadManager; |
|
.end annotation |
|
|
|
.annotation system Ldalvik/annotation/InnerClass; |
|
accessFlags = 0x9 |
|
name = "ThreadPoolProxy" |
|
.end annotation |
|
|
|
|
|
# instance fields |
|
.field private final mCorePoolSize:I |
|
|
|
.field private final mKeepAliveTime:J |
|
|
|
.field private final mMaximumPoolSize:I |
|
|
|
.field private mPool:Ljava/util/concurrent/ThreadPoolExecutor; |
|
|
|
|
|
# direct methods |
|
.method public constructor <init>(IIJ)V |
|
.locals 1 |
|
|
|
.prologue |
|
.line 29 |
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V |
|
|
|
.line 30 |
|
iput p1, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mCorePoolSize:I |
|
|
|
.line 31 |
|
iput p2, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mMaximumPoolSize:I |
|
|
|
.line 32 |
|
iput-wide p3, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mKeepAliveTime:J |
|
|
|
.line 33 |
|
return-void |
|
.end method |
|
|
|
.method private initPool()V |
|
.locals 10 |
|
|
|
.prologue |
|
.line 36 |
|
iget-object v0, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mPool:Ljava/util/concurrent/ThreadPoolExecutor; |
|
|
|
if-eqz v0, :cond_0 |
|
|
|
iget-object v0, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mPool:Ljava/util/concurrent/ThreadPoolExecutor; |
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/ThreadPoolExecutor;->isShutdown()Z |
|
|
|
move-result v0 |
|
|
|
if-eqz v0, :cond_1 |
|
|
|
.line 40 |
|
:cond_0 |
|
sget-object v6, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit; |
|
|
|
.line 44 |
|
new-instance v7, Ljava/util/concurrent/LinkedBlockingQueue; |
|
|
|
invoke-direct {v7}, Ljava/util/concurrent/LinkedBlockingQueue;-><init>()V |
|
|
|
.line 47 |
|
invoke-static {}, Ljava/util/concurrent/Executors;->defaultThreadFactory()Ljava/util/concurrent/ThreadFactory; |
|
|
|
move-result-object v8 |
|
|
|
.line 53 |
|
new-instance v9, Ljava/util/concurrent/ThreadPoolExecutor$DiscardPolicy; |
|
|
|
invoke-direct {v9}, Ljava/util/concurrent/ThreadPoolExecutor$DiscardPolicy;-><init>()V |
|
|
|
.line 58 |
|
new-instance v1, Ljava/util/concurrent/ThreadPoolExecutor; |
|
|
|
iget v2, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mCorePoolSize:I |
|
|
|
iget v3, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mMaximumPoolSize:I |
|
|
|
iget-wide v4, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mKeepAliveTime:J |
|
|
|
invoke-direct/range {v1 .. v9}, Ljava/util/concurrent/ThreadPoolExecutor;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;Ljava/util/concurrent/RejectedExecutionHandler;)V |
|
|
|
iput-object v1, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mPool:Ljava/util/concurrent/ThreadPoolExecutor; |
|
|
|
.line 66 |
|
:cond_1 |
|
return-void |
|
.end method |
|
|
|
|
|
# virtual methods |
|
.method public execute(Ljava/lang/Runnable;)V |
|
.locals 1 |
|
|
|
.prologue |
|
.line 73 |
|
invoke-direct {p0}, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->initPool()V |
|
|
|
.line 76 |
|
iget-object v0, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mPool:Ljava/util/concurrent/ThreadPoolExecutor; |
|
|
|
invoke-virtual {v0, p1}, Ljava/util/concurrent/ThreadPoolExecutor;->execute(Ljava/lang/Runnable;)V |
|
|
|
.line 77 |
|
return-void |
|
.end method |
|
|
|
.method public remove(Ljava/lang/Runnable;)V |
|
.locals 1 |
|
|
|
.prologue |
|
.line 86 |
|
iget-object v0, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mPool:Ljava/util/concurrent/ThreadPoolExecutor; |
|
|
|
if-eqz v0, :cond_0 |
|
|
|
iget-object v0, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mPool:Ljava/util/concurrent/ThreadPoolExecutor; |
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/ThreadPoolExecutor;->isShutdown()Z |
|
|
|
move-result v0 |
|
|
|
if-nez v0, :cond_0 |
|
|
|
.line 87 |
|
iget-object v0, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mPool:Ljava/util/concurrent/ThreadPoolExecutor; |
|
|
|
invoke-virtual {v0}, Ljava/util/concurrent/ThreadPoolExecutor;->getQueue()Ljava/util/concurrent/BlockingQueue; |
|
|
|
move-result-object v0 |
|
|
|
.line 88 |
|
invoke-interface {v0, p1}, Ljava/util/concurrent/BlockingQueue;->remove(Ljava/lang/Object;)Z |
|
|
|
.line 90 |
|
:cond_0 |
|
return-void |
|
.end method |
|
|
|
.method public submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future; |
|
.locals 1 |
|
.annotation system Ldalvik/annotation/Signature; |
|
value = { |
|
"(", |
|
"Ljava/lang/Runnable;", |
|
")", |
|
"Ljava/util/concurrent/Future", |
|
"<*>;" |
|
} |
|
.end annotation |
|
|
|
.prologue |
|
.line 81 |
|
invoke-direct {p0}, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->initPool()V |
|
|
|
.line 82 |
|
iget-object v0, p0, Lcom/viatech/util/ThreadManager$ThreadPoolProxy;->mPool:Ljava/util/concurrent/ThreadPoolExecutor; |
|
|
|
invoke-virtual {v0, p1}, Ljava/util/concurrent/ThreadPoolExecutor;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future; |
|
|
|
move-result-object v0 |
|
|
|
return-object v0 |
|
.end method
|
|
|