TestScheduler$TestWorker.smali
6.5 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
.class final Lio/reactivex/schedulers/TestScheduler$TestWorker;
.super Lio/reactivex/Scheduler$Worker;
.source "TestScheduler.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lio/reactivex/schedulers/TestScheduler;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x10
name = "TestWorker"
.end annotation
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lio/reactivex/schedulers/TestScheduler$TestWorker$QueueRemove;
}
.end annotation
# instance fields
.field volatile disposed:Z
.field final synthetic this$0:Lio/reactivex/schedulers/TestScheduler;
# direct methods
.method constructor <init>(Lio/reactivex/schedulers/TestScheduler;)V
.locals 0
.line 147
iput-object p1, p0, Lio/reactivex/schedulers/TestScheduler$TestWorker;->this$0:Lio/reactivex/schedulers/TestScheduler;
invoke-direct {p0}, Lio/reactivex/Scheduler$Worker;-><init>()V
return-void
.end method
# virtual methods
.method public dispose()V
.locals 1
const/4 v0, 0x1
.line 153
iput-boolean v0, p0, Lio/reactivex/schedulers/TestScheduler$TestWorker;->disposed:Z
return-void
.end method
.method public isDisposed()Z
.locals 1
.line 158
iget-boolean v0, p0, Lio/reactivex/schedulers/TestScheduler$TestWorker;->disposed:Z
return v0
.end method
.method public now(Ljava/util/concurrent/TimeUnit;)J
.locals 2
.param p1 # Ljava/util/concurrent/TimeUnit;
.annotation build Lio/reactivex/annotations/NonNull;
.end annotation
.end param
.line 186
iget-object v0, p0, Lio/reactivex/schedulers/TestScheduler$TestWorker;->this$0:Lio/reactivex/schedulers/TestScheduler;
invoke-virtual {v0, p1}, Lio/reactivex/schedulers/TestScheduler;->now(Ljava/util/concurrent/TimeUnit;)J
move-result-wide v0
return-wide v0
.end method
.method public schedule(Ljava/lang/Runnable;)Lio/reactivex/disposables/Disposable;
.locals 10
.param p1 # Ljava/lang/Runnable;
.annotation build Lio/reactivex/annotations/NonNull;
.end annotation
.end param
.annotation build Lio/reactivex/annotations/NonNull;
.end annotation
.line 176
iget-boolean v0, p0, Lio/reactivex/schedulers/TestScheduler$TestWorker;->disposed:Z
if-eqz v0, :cond_0
.line 177
sget-object p1, Lio/reactivex/internal/disposables/EmptyDisposable;->INSTANCE:Lio/reactivex/internal/disposables/EmptyDisposable;
return-object p1
.line 179
:cond_0
new-instance v7, Lio/reactivex/schedulers/TestScheduler$TimedRunnable;
const-wide/16 v2, 0x0
iget-object v0, p0, Lio/reactivex/schedulers/TestScheduler$TestWorker;->this$0:Lio/reactivex/schedulers/TestScheduler;
iget-wide v5, v0, Lio/reactivex/schedulers/TestScheduler;->counter:J
const-wide/16 v8, 0x1
add-long/2addr v8, v5
iput-wide v8, v0, Lio/reactivex/schedulers/TestScheduler;->counter:J
move-object v0, v7
move-object v1, p0
move-object v4, p1
invoke-direct/range {v0 .. v6}, Lio/reactivex/schedulers/TestScheduler$TimedRunnable;-><init>(Lio/reactivex/schedulers/TestScheduler$TestWorker;JLjava/lang/Runnable;J)V
.line 180
iget-object p1, p0, Lio/reactivex/schedulers/TestScheduler$TestWorker;->this$0:Lio/reactivex/schedulers/TestScheduler;
iget-object p1, p1, Lio/reactivex/schedulers/TestScheduler;->queue:Ljava/util/Queue;
invoke-interface {p1, v7}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z
.line 181
new-instance p1, Lio/reactivex/schedulers/TestScheduler$TestWorker$QueueRemove;
invoke-direct {p1, p0, v7}, Lio/reactivex/schedulers/TestScheduler$TestWorker$QueueRemove;-><init>(Lio/reactivex/schedulers/TestScheduler$TestWorker;Lio/reactivex/schedulers/TestScheduler$TimedRunnable;)V
invoke-static {p1}, Lio/reactivex/disposables/Disposables;->fromRunnable(Ljava/lang/Runnable;)Lio/reactivex/disposables/Disposable;
move-result-object p1
return-object p1
.end method
.method public schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Lio/reactivex/disposables/Disposable;
.locals 8
.param p1 # Ljava/lang/Runnable;
.annotation build Lio/reactivex/annotations/NonNull;
.end annotation
.end param
.param p4 # Ljava/util/concurrent/TimeUnit;
.annotation build Lio/reactivex/annotations/NonNull;
.end annotation
.end param
.annotation build Lio/reactivex/annotations/NonNull;
.end annotation
.line 164
iget-boolean v0, p0, Lio/reactivex/schedulers/TestScheduler$TestWorker;->disposed:Z
if-eqz v0, :cond_0
.line 165
sget-object p1, Lio/reactivex/internal/disposables/EmptyDisposable;->INSTANCE:Lio/reactivex/internal/disposables/EmptyDisposable;
return-object p1
.line 167
:cond_0
new-instance v7, Lio/reactivex/schedulers/TestScheduler$TimedRunnable;
iget-object v0, p0, Lio/reactivex/schedulers/TestScheduler$TestWorker;->this$0:Lio/reactivex/schedulers/TestScheduler;
iget-wide v0, v0, Lio/reactivex/schedulers/TestScheduler;->time:J
invoke-virtual {p4, p2, p3}, Ljava/util/concurrent/TimeUnit;->toNanos(J)J
move-result-wide p2
add-long v2, v0, p2
iget-object p2, p0, Lio/reactivex/schedulers/TestScheduler$TestWorker;->this$0:Lio/reactivex/schedulers/TestScheduler;
iget-wide v5, p2, Lio/reactivex/schedulers/TestScheduler;->counter:J
const-wide/16 p3, 0x1
add-long/2addr p3, v5
iput-wide p3, p2, Lio/reactivex/schedulers/TestScheduler;->counter:J
move-object v0, v7
move-object v1, p0
move-object v4, p1
invoke-direct/range {v0 .. v6}, Lio/reactivex/schedulers/TestScheduler$TimedRunnable;-><init>(Lio/reactivex/schedulers/TestScheduler$TestWorker;JLjava/lang/Runnable;J)V
.line 168
iget-object p1, p0, Lio/reactivex/schedulers/TestScheduler$TestWorker;->this$0:Lio/reactivex/schedulers/TestScheduler;
iget-object p1, p1, Lio/reactivex/schedulers/TestScheduler;->queue:Ljava/util/Queue;
invoke-interface {p1, v7}, Ljava/util/Queue;->add(Ljava/lang/Object;)Z
.line 170
new-instance p1, Lio/reactivex/schedulers/TestScheduler$TestWorker$QueueRemove;
invoke-direct {p1, p0, v7}, Lio/reactivex/schedulers/TestScheduler$TestWorker$QueueRemove;-><init>(Lio/reactivex/schedulers/TestScheduler$TestWorker;Lio/reactivex/schedulers/TestScheduler$TimedRunnable;)V
invoke-static {p1}, Lio/reactivex/disposables/Disposables;->fromRunnable(Ljava/lang/Runnable;)Lio/reactivex/disposables/Disposable;
move-result-object p1
return-object p1
.end method