apkfuckery/com.discord/smali/androidx/room/TransactionExecutor.smali

121 lines
3 KiB
Smali
Raw Normal View History

2019-12-06 03:29:40 +00:00
.class public Landroidx/room/TransactionExecutor;
2019-10-07 23:23:22 +00:00
.super Ljava/lang/Object;
.source "TransactionExecutor.java"
# interfaces
.implements Ljava/util/concurrent/Executor;
# instance fields
2019-12-06 03:29:40 +00:00
.field public mActive:Ljava/lang/Runnable;
2019-10-07 23:23:22 +00:00
2019-12-06 03:29:40 +00:00
.field public final mExecutor:Ljava/util/concurrent/Executor;
2019-10-07 23:23:22 +00:00
2019-12-06 03:29:40 +00:00
.field public final mTasks:Ljava/util/ArrayDeque;
2019-10-07 23:23:22 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/ArrayDeque<",
"Ljava/lang/Runnable;",
">;"
}
.end annotation
.end field
# direct methods
2019-12-06 03:29:40 +00:00
.method public constructor <init>(Ljava/util/concurrent/Executor;)V
2019-10-07 23:23:22 +00:00
.locals 1
2019-12-06 03:29:40 +00:00
.param p1 # Ljava/util/concurrent/Executor;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
2019-10-07 23:23:22 +00:00
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
new-instance v0, Ljava/util/ArrayDeque;
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
iput-object v0, p0, Landroidx/room/TransactionExecutor;->mTasks:Ljava/util/ArrayDeque;
iput-object p1, p0, Landroidx/room/TransactionExecutor;->mExecutor:Ljava/util/concurrent/Executor;
return-void
.end method
# virtual methods
.method public declared-synchronized execute(Ljava/lang/Runnable;)V
.locals 2
monitor-enter p0
:try_start_0
iget-object v0, p0, Landroidx/room/TransactionExecutor;->mTasks:Ljava/util/ArrayDeque;
new-instance v1, Landroidx/room/TransactionExecutor$1;
invoke-direct {v1, p0, p1}, Landroidx/room/TransactionExecutor$1;-><init>(Landroidx/room/TransactionExecutor;Ljava/lang/Runnable;)V
invoke-virtual {v0, v1}, Ljava/util/ArrayDeque;->offer(Ljava/lang/Object;)Z
iget-object p1, p0, Landroidx/room/TransactionExecutor;->mActive:Ljava/lang/Runnable;
if-nez p1, :cond_0
invoke-virtual {p0}, Landroidx/room/TransactionExecutor;->scheduleNext()V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:cond_0
monitor-exit p0
return-void
:catchall_0
move-exception p1
monitor-exit p0
throw p1
.end method
2019-12-06 03:29:40 +00:00
.method public declared-synchronized scheduleNext()V
2019-10-07 23:23:22 +00:00
.locals 2
monitor-enter p0
:try_start_0
iget-object v0, p0, Landroidx/room/TransactionExecutor;->mTasks:Ljava/util/ArrayDeque;
invoke-virtual {v0}, Ljava/util/ArrayDeque;->poll()Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/lang/Runnable;
iput-object v0, p0, Landroidx/room/TransactionExecutor;->mActive:Ljava/lang/Runnable;
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/room/TransactionExecutor;->mExecutor:Ljava/util/concurrent/Executor;
iget-object v1, p0, Landroidx/room/TransactionExecutor;->mActive:Ljava/lang/Runnable;
invoke-interface {v0, v1}, Ljava/util/concurrent/Executor;->execute(Ljava/lang/Runnable;)V
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
:cond_0
monitor-exit p0
return-void
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method