IntervalLock.smali

.class public Lcom/tradplus/ads/base/common/IntervalLock;
.super Ljava/lang/Object;


# instance fields
.field private a:Z

.field private b:J

.field private c:J


# direct methods
.method public constructor <init>(J)V
    .registers 5

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/tradplus/ads/base/common/IntervalLock;->a:Z

    const-wide/16 v0, 0x0

    iput-wide v0, p0, Lcom/tradplus/ads/base/common/IntervalLock;->b:J

    iput-wide p1, p0, Lcom/tradplus/ads/base/common/IntervalLock;->c:J

    return-void
.end method


# virtual methods
.method public declared-synchronized isLocked()Z
    .registers 9

    monitor-enter p0

    :try_start_1
    iget-wide v0, p0, Lcom/tradplus/ads/base/common/IntervalLock;->b:J

    const-wide/16 v2, 0x0

    cmp-long v4, v0, v2

    if-lez v4, :cond_1b

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iget-wide v4, p0, Lcom/tradplus/ads/base/common/IntervalLock;->b:J

    iget-wide v6, p0, Lcom/tradplus/ads/base/common/IntervalLock;->c:J

    add-long/2addr v4, v6

    cmp-long v6, v0, v4

    if-lez v6, :cond_1b

    iput-wide v2, p0, Lcom/tradplus/ads/base/common/IntervalLock;->b:J

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/tradplus/ads/base/common/IntervalLock;->a:Z

    :cond_1b
    iget-boolean v0, p0, Lcom/tradplus/ads/base/common/IntervalLock;->a:Z
    :try_end_1d
    .catchall {:try_start_1 .. :try_end_1d} :catchall_1f

    monitor-exit p0

    return v0

    :catchall_1f
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized setExpireSecond(J)V
    .registers 6

    monitor-enter p0

    const-wide/16 v0, 0xe10

    cmp-long v2, p1, v0

    if-lez v2, :cond_8

    move-wide p1, v0

    :cond_8
    const-wide/16 v0, 0x3e8

    mul-long p1, p1, v0

    :try_start_c
    iput-wide p1, p0, Lcom/tradplus/ads/base/common/IntervalLock;->c:J
    :try_end_e
    .catchall {:try_start_c .. :try_end_e} :catchall_10

    monitor-exit p0

    return-void

    :catchall_10
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public declared-synchronized tryLock()V
    .registers 3

    monitor-enter p0

    :try_start_1
    iget-boolean v0, p0, Lcom/tradplus/ads/base/common/IntervalLock;->a:Z

    if-nez v0, :cond_e

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iput-wide v0, p0, Lcom/tradplus/ads/base/common/IntervalLock;->b:J

    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/tradplus/ads/base/common/IntervalLock;->a:Z
    :try_end_e
    .catchall {:try_start_1 .. :try_end_e} :catchall_10

    :cond_e
    monitor-exit p0

    return-void

    :catchall_10
    move-exception v0

    monitor-exit p0

    throw v0
.end method