221 lines
5.1 KiB
Smali
221 lines
5.1 KiB
Smali
|
.class public final Lg0/m/c/d;
|
||
|
.super Ljava/lang/Object;
|
||
|
.source "GenericScheduledExecutorService.java"
|
||
|
|
||
|
# interfaces
|
||
|
.implements Lg0/m/c/l;
|
||
|
|
||
|
|
||
|
# static fields
|
||
|
.field public static final b:[Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
.field public static final c:Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
.field public static final d:Lg0/m/c/d;
|
||
|
|
||
|
.field public static e:I
|
||
|
|
||
|
|
||
|
# instance fields
|
||
|
.field public final a:Ljava/util/concurrent/atomic/AtomicReference;
|
||
|
.annotation system Ldalvik/annotation/Signature;
|
||
|
value = {
|
||
|
"Ljava/util/concurrent/atomic/AtomicReference<",
|
||
|
"[",
|
||
|
"Ljava/util/concurrent/ScheduledExecutorService;",
|
||
|
">;"
|
||
|
}
|
||
|
.end annotation
|
||
|
.end field
|
||
|
|
||
|
|
||
|
# direct methods
|
||
|
.method public static constructor <clinit>()V
|
||
|
.locals 2
|
||
|
|
||
|
const/4 v0, 0x0
|
||
|
|
||
|
new-array v1, v0, [Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
sput-object v1, Lg0/m/c/d;->b:[Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
invoke-static {v0}, Ljava/util/concurrent/Executors;->newScheduledThreadPool(I)Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
sput-object v0, Lg0/m/c/d;->c:Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
sget-object v0, Lg0/m/c/d;->c:Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
invoke-interface {v0}, Ljava/util/concurrent/ScheduledExecutorService;->shutdown()V
|
||
|
|
||
|
new-instance v0, Lg0/m/c/d;
|
||
|
|
||
|
invoke-direct {v0}, Lg0/m/c/d;-><init>()V
|
||
|
|
||
|
sput-object v0, Lg0/m/c/d;->d:Lg0/m/c/d;
|
||
|
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
.method public constructor <init>()V
|
||
|
.locals 5
|
||
|
|
||
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
||
|
|
||
|
new-instance v0, Ljava/util/concurrent/atomic/AtomicReference;
|
||
|
|
||
|
sget-object v1, Lg0/m/c/d;->b:[Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
invoke-direct {v0, v1}, Ljava/util/concurrent/atomic/AtomicReference;-><init>(Ljava/lang/Object;)V
|
||
|
|
||
|
iput-object v0, p0, Lg0/m/c/d;->a:Ljava/util/concurrent/atomic/AtomicReference;
|
||
|
|
||
|
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/lang/Runtime;->availableProcessors()I
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
const/4 v1, 0x4
|
||
|
|
||
|
if-le v0, v1, :cond_0
|
||
|
|
||
|
div-int/lit8 v0, v0, 0x2
|
||
|
|
||
|
:cond_0
|
||
|
const/16 v1, 0x8
|
||
|
|
||
|
if-le v0, v1, :cond_1
|
||
|
|
||
|
const/16 v0, 0x8
|
||
|
|
||
|
:cond_1
|
||
|
new-array v1, v0, [Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
const/4 v3, 0x0
|
||
|
|
||
|
:goto_0
|
||
|
if-ge v3, v0, :cond_2
|
||
|
|
||
|
invoke-static {}, Lg0/m/c/e;->a()Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
move-result-object v4
|
||
|
|
||
|
aput-object v4, v1, v3
|
||
|
|
||
|
add-int/lit8 v3, v3, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_2
|
||
|
iget-object v0, p0, Lg0/m/c/d;->a:Ljava/util/concurrent/atomic/AtomicReference;
|
||
|
|
||
|
sget-object v3, Lg0/m/c/d;->b:[Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
invoke-virtual {v0, v3, v1}, Ljava/util/concurrent/atomic/AtomicReference;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v0
|
||
|
|
||
|
if-eqz v0, :cond_4
|
||
|
|
||
|
array-length v0, v1
|
||
|
|
||
|
:goto_1
|
||
|
if-ge v2, v0, :cond_5
|
||
|
|
||
|
aget-object v3, v1, v2
|
||
|
|
||
|
invoke-static {v3}, Lg0/m/c/h;->b(Ljava/util/concurrent/ScheduledExecutorService;)Z
|
||
|
|
||
|
move-result v4
|
||
|
|
||
|
if-nez v4, :cond_3
|
||
|
|
||
|
instance-of v4, v3, Ljava/util/concurrent/ScheduledThreadPoolExecutor;
|
||
|
|
||
|
if-eqz v4, :cond_3
|
||
|
|
||
|
check-cast v3, Ljava/util/concurrent/ScheduledThreadPoolExecutor;
|
||
|
|
||
|
invoke-static {v3}, Lg0/m/c/h;->a(Ljava/util/concurrent/ScheduledThreadPoolExecutor;)V
|
||
|
|
||
|
:cond_3
|
||
|
add-int/lit8 v2, v2, 0x1
|
||
|
|
||
|
goto :goto_1
|
||
|
|
||
|
:cond_4
|
||
|
array-length v0, v1
|
||
|
|
||
|
:goto_2
|
||
|
if-ge v2, v0, :cond_5
|
||
|
|
||
|
aget-object v3, v1, v2
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/concurrent/ScheduledExecutorService;->shutdownNow()Ljava/util/List;
|
||
|
|
||
|
add-int/lit8 v2, v2, 0x1
|
||
|
|
||
|
goto :goto_2
|
||
|
|
||
|
:cond_5
|
||
|
return-void
|
||
|
.end method
|
||
|
|
||
|
|
||
|
# virtual methods
|
||
|
.method public shutdown()V
|
||
|
.locals 5
|
||
|
|
||
|
:cond_0
|
||
|
iget-object v0, p0, Lg0/m/c/d;->a:Ljava/util/concurrent/atomic/AtomicReference;
|
||
|
|
||
|
invoke-virtual {v0}, Ljava/util/concurrent/atomic/AtomicReference;->get()Ljava/lang/Object;
|
||
|
|
||
|
move-result-object v0
|
||
|
|
||
|
check-cast v0, [Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
sget-object v1, Lg0/m/c/d;->b:[Ljava/util/concurrent/ScheduledExecutorService;
|
||
|
|
||
|
if-ne v0, v1, :cond_1
|
||
|
|
||
|
return-void
|
||
|
|
||
|
:cond_1
|
||
|
iget-object v2, p0, Lg0/m/c/d;->a:Ljava/util/concurrent/atomic/AtomicReference;
|
||
|
|
||
|
invoke-virtual {v2, v0, v1}, Ljava/util/concurrent/atomic/AtomicReference;->compareAndSet(Ljava/lang/Object;Ljava/lang/Object;)Z
|
||
|
|
||
|
move-result v1
|
||
|
|
||
|
if-eqz v1, :cond_0
|
||
|
|
||
|
array-length v1, v0
|
||
|
|
||
|
const/4 v2, 0x0
|
||
|
|
||
|
:goto_0
|
||
|
if-ge v2, v1, :cond_2
|
||
|
|
||
|
aget-object v3, v0, v2
|
||
|
|
||
|
sget-object v4, Lg0/m/c/h;->h:Ljava/util/concurrent/ConcurrentHashMap;
|
||
|
|
||
|
invoke-virtual {v4, v3}, Ljava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;
|
||
|
|
||
|
invoke-interface {v3}, Ljava/util/concurrent/ScheduledExecutorService;->shutdownNow()Ljava/util/List;
|
||
|
|
||
|
add-int/lit8 v2, v2, 0x1
|
||
|
|
||
|
goto :goto_0
|
||
|
|
||
|
:cond_2
|
||
|
return-void
|
||
|
.end method
|