222 lines
4.6 KiB
Smali
222 lines
4.6 KiB
Smali
.class public Lf/c/a/f2/c;
|
|
.super Ljava/lang/Object;
|
|
.source "SingleThreadCachedScheduler.java"
|
|
|
|
# interfaces
|
|
.implements Lf/c/a/f2/h;
|
|
|
|
|
|
# instance fields
|
|
.field public final a:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Ljava/lang/Runnable;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public b:Z
|
|
|
|
.field public c:Z
|
|
|
|
.field public d:Ljava/util/concurrent/ThreadPoolExecutor;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Ljava/lang/String;)V
|
|
.locals 10
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
iput-object v0, p0, Lf/c/a/f2/c;->a:Ljava/util/List;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-boolean v0, p0, Lf/c/a/f2/c;->b:Z
|
|
|
|
iput-boolean v0, p0, Lf/c/a/f2/c;->c:Z
|
|
|
|
new-instance v0, Ljava/util/concurrent/ThreadPoolExecutor;
|
|
|
|
sget-object v6, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
new-instance v7, Ljava/util/concurrent/SynchronousQueue;
|
|
|
|
invoke-direct {v7}, Ljava/util/concurrent/SynchronousQueue;-><init>()V
|
|
|
|
new-instance v8, Lf/c/a/f2/g;
|
|
|
|
invoke-direct {v8, p1}, Lf/c/a/f2/g;-><init>(Ljava/lang/String;)V
|
|
|
|
new-instance v9, Lf/c/a/f2/c$a;
|
|
|
|
invoke-direct {v9, p0, p1}, Lf/c/a/f2/c$a;-><init>(Lf/c/a/f2/c;Ljava/lang/String;)V
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const v3, 0x7fffffff
|
|
|
|
const-wide/16 v4, 0x3c
|
|
|
|
move-object v1, v0
|
|
|
|
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 v0, p0, Lf/c/a/f2/c;->d:Ljava/util/concurrent/ThreadPoolExecutor;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static a(Lf/c/a/f2/c;Ljava/lang/Runnable;)V
|
|
.locals 2
|
|
|
|
if-eqz p0, :cond_1
|
|
|
|
:try_start_0
|
|
iget-boolean p0, p0, Lf/c/a/f2/c;->c:Z
|
|
|
|
if-eqz p0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-interface {p1}, Ljava/lang/Runnable;->run()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
:catchall_0
|
|
move-exception p0
|
|
|
|
invoke-static {}, Lf/c/a/a0;->a()Lf/c/a/w0;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [Ljava/lang/Object;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {p0}, Ljava/lang/Throwable;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object p0
|
|
|
|
aput-object p0, v0, v1
|
|
|
|
const-string p0, "Execution failed: %s"
|
|
|
|
invoke-interface {p1, p0, v0}, Lf/c/a/w0;->d(Ljava/lang/String;[Ljava/lang/Object;)V
|
|
|
|
:goto_0
|
|
return-void
|
|
|
|
:cond_1
|
|
const/4 p0, 0x0
|
|
|
|
throw p0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public b(Ljava/lang/Runnable;J)V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lf/c/a/f2/c;->a:Ljava/util/List;
|
|
|
|
monitor-enter v0
|
|
|
|
:try_start_0
|
|
iget-boolean v1, p0, Lf/c/a/f2/c;->c:Z
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iget-object v1, p0, Lf/c/a/f2/c;->d:Ljava/util/concurrent/ThreadPoolExecutor;
|
|
|
|
new-instance v2, Lf/c/a/f2/c$b;
|
|
|
|
invoke-direct {v2, p0, p2, p3, p1}, Lf/c/a/f2/c$b;-><init>(Lf/c/a/f2/c;JLjava/lang/Runnable;)V
|
|
|
|
invoke-virtual {v1, v2}, Ljava/util/concurrent/ThreadPoolExecutor;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;
|
|
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public c(Ljava/lang/Runnable;)V
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lf/c/a/f2/c;->a:Ljava/util/List;
|
|
|
|
monitor-enter v0
|
|
|
|
:try_start_0
|
|
iget-boolean v1, p0, Lf/c/a/f2/c;->c:Z
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iget-boolean v1, p0, Lf/c/a/f2/c;->b:Z
|
|
|
|
if-nez v1, :cond_1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
iput-boolean v1, p0, Lf/c/a/f2/c;->b:Z
|
|
|
|
iget-object v1, p0, Lf/c/a/f2/c;->d:Ljava/util/concurrent/ThreadPoolExecutor;
|
|
|
|
new-instance v2, Lf/c/a/f2/d;
|
|
|
|
invoke-direct {v2, p0, p1}, Lf/c/a/f2/d;-><init>(Lf/c/a/f2/c;Ljava/lang/Runnable;)V
|
|
|
|
invoke-virtual {v1, v2}, Ljava/util/concurrent/ThreadPoolExecutor;->submit(Ljava/lang/Runnable;)Ljava/util/concurrent/Future;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
iget-object v1, p0, Lf/c/a/f2/c;->a:Ljava/util/List;
|
|
|
|
invoke-interface {v1, p1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
:goto_0
|
|
monitor-exit v0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit v0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
throw p1
|
|
.end method
|