w.smali
3.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
.class public Lcom/bytedance/bdtracker/w;
.super Ljava/lang/Object;
.source ""
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/bytedance/bdtracker/w$b;
}
.end annotation
# static fields
.field public static a:Ljava/util/concurrent/ExecutorService;
.field public static final b:I
.field public static final c:I
.field public static final d:I
.field public static final e:I
.field public static final f:Ljava/util/concurrent/BlockingQueue;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/concurrent/BlockingQueue<",
"Ljava/lang/Runnable;",
">;"
}
.end annotation
.end field
.field public static final g:Lcom/bytedance/bdtracker/w$b;
.field public static final h:Ljava/util/concurrent/RejectedExecutionHandler;
# direct methods
.method public static constructor <clinit>()V
.locals 11
invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Runtime;->availableProcessors()I
move-result v0
sput v0, Lcom/bytedance/bdtracker/w;->b:I
sget v0, Lcom/bytedance/bdtracker/w;->b:I
const/4 v1, 0x1
if-lez v0, :cond_0
goto :goto_0
:cond_0
move v0, v1
:goto_0
sput v0, Lcom/bytedance/bdtracker/w;->c:I
sget v0, Lcom/bytedance/bdtracker/w;->c:I
sub-int/2addr v0, v1
const/4 v2, 0x6
invoke-static {v0, v2}, Ljava/lang/Math;->min(II)I
move-result v0
const/4 v2, 0x2
invoke-static {v2, v0}, Ljava/lang/Math;->max(II)I
move-result v0
mul-int/2addr v0, v2
sput v0, Lcom/bytedance/bdtracker/w;->d:I
sget v0, Lcom/bytedance/bdtracker/w;->d:I
mul-int/2addr v0, v2
add-int/2addr v0, v1
sput v0, Lcom/bytedance/bdtracker/w;->e:I
new-instance v0, Ljava/util/concurrent/LinkedBlockingQueue;
invoke-direct {v0}, Ljava/util/concurrent/LinkedBlockingQueue;-><init>()V
sput-object v0, Lcom/bytedance/bdtracker/w;->f:Ljava/util/concurrent/BlockingQueue;
new-instance v0, Lcom/bytedance/bdtracker/w$b;
const-string v2, "TTDefaultExecutors"
invoke-direct {v0, v2}, Lcom/bytedance/bdtracker/w$b;-><init>(Ljava/lang/String;)V
sput-object v0, Lcom/bytedance/bdtracker/w;->g:Lcom/bytedance/bdtracker/w$b;
new-instance v0, Lcom/bytedance/bdtracker/w$a;
invoke-direct {v0}, Lcom/bytedance/bdtracker/w$a;-><init>()V
sput-object v0, Lcom/bytedance/bdtracker/w;->h:Ljava/util/concurrent/RejectedExecutionHandler;
new-instance v0, Lcom/bytedance/bdtracker/x;
sget v3, Lcom/bytedance/bdtracker/w;->d:I
sget v4, Lcom/bytedance/bdtracker/w;->e:I
sget-object v7, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
sget-object v8, Lcom/bytedance/bdtracker/w;->f:Ljava/util/concurrent/BlockingQueue;
sget-object v9, Lcom/bytedance/bdtracker/w;->g:Lcom/bytedance/bdtracker/w$b;
sget-object v10, Lcom/bytedance/bdtracker/w;->h:Ljava/util/concurrent/RejectedExecutionHandler;
const-wide/16 v5, 0x1e
move-object v2, v0
invoke-direct/range {v2 .. v10}, Lcom/bytedance/bdtracker/x;-><init>(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;Ljava/util/concurrent/RejectedExecutionHandler;)V
sput-object v0, Lcom/bytedance/bdtracker/w;->a:Ljava/util/concurrent/ExecutorService;
sget-object v0, Lcom/bytedance/bdtracker/w;->a:Ljava/util/concurrent/ExecutorService;
check-cast v0, Lcom/bytedance/bdtracker/x;
invoke-virtual {v0, v1}, Ljava/util/concurrent/ThreadPoolExecutor;->allowCoreThreadTimeOut(Z)V
return-void
.end method