RustableLock.smali
.class public Lcom/tradplus/ads/common/RustableLock;
.super Ljava/lang/Object;
# instance fields
.field private a:Z
.field private b:J
.field private c:J
# direct methods
.method public constructor <init>()V
.registers 3
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/tradplus/ads/common/RustableLock;->a:Z
const-wide/16 v0, 0x0
iput-wide v0, p0, Lcom/tradplus/ads/common/RustableLock;->b:J
iput-wide v0, p0, Lcom/tradplus/ads/common/RustableLock;->c:J
return-void
.end method
# virtual methods
.method public isLocked()Z
.registers 2
iget-boolean v0, p0, Lcom/tradplus/ads/common/RustableLock;->a:Z
return v0
.end method
.method public setLockExpireTime(J)V
.registers 3
monitor-enter p0
:try_start_1
iput-wide p1, p0, Lcom/tradplus/ads/common/RustableLock;->c:J
monitor-exit p0
return-void
:catchall_5
move-exception p1
monitor-exit p0
:try_end_7
.catchall {:try_start_1 .. :try_end_7} :catchall_5
throw p1
.end method
.method public tryLock()Z
.registers 9
monitor-enter p0
:try_start_1
iget-boolean v0, p0, Lcom/tradplus/ads/common/RustableLock;->a:Z
const/4 v1, 0x1
if-nez v0, :cond_10
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v2
iput-wide v2, p0, Lcom/tradplus/ads/common/RustableLock;->b:J
iput-boolean v1, p0, Lcom/tradplus/ads/common/RustableLock;->a:Z
monitor-exit p0
return v1
:cond_10
iget-wide v2, p0, Lcom/tradplus/ads/common/RustableLock;->c:J
const-wide/16 v4, 0x0
cmp-long v0, v2, v4
if-lez v0, :cond_2f
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v2
iget-wide v4, p0, Lcom/tradplus/ads/common/RustableLock;->b:J
iget-wide v6, p0, Lcom/tradplus/ads/common/RustableLock;->c:J
add-long/2addr v4, v6
cmp-long v0, v2, v4
if-lez v0, :cond_2f
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
move-result-wide v2
iput-wide v2, p0, Lcom/tradplus/ads/common/RustableLock;->b:J
iput-boolean v1, p0, Lcom/tradplus/ads/common/RustableLock;->a:Z
monitor-exit p0
return v1
:cond_2f
const/4 v0, 0x0
monitor-exit p0
return v0
:catchall_32
move-exception v0
monitor-exit p0
:try_end_34
.catchall {:try_start_1 .. :try_end_34} :catchall_32
throw v0
.end method
.method public unlock()V
.registers 2
monitor-enter p0
const/4 v0, 0x0
:try_start_2
iput-boolean v0, p0, Lcom/tradplus/ads/common/RustableLock;->a:Z
monitor-exit p0
return-void
:catchall_6
move-exception v0
monitor-exit p0
:try_end_8
.catchall {:try_start_2 .. :try_end_8} :catchall_6
throw v0
.end method