mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2024-12-30 11:02:31 -06:00
35 lines
1.1 KiB
Java
35 lines
1.1 KiB
Java
|
package io.sentry.hints;
|
||
|
|
||
|
import io.sentry.ILogger;
|
||
|
import io.sentry.SentryLevel;
|
||
|
import java.util.concurrent.CountDownLatch;
|
||
|
import java.util.concurrent.TimeUnit;
|
||
|
|
||
|
/* loaded from: classes3.dex */
|
||
|
public abstract class BlockingFlushHint implements DiskFlushNotification, Flushable {
|
||
|
private final long flushTimeoutMillis;
|
||
|
private final CountDownLatch latch = new CountDownLatch(1);
|
||
|
private final ILogger logger;
|
||
|
|
||
|
public BlockingFlushHint(long j, ILogger iLogger) {
|
||
|
this.flushTimeoutMillis = j;
|
||
|
this.logger = iLogger;
|
||
|
}
|
||
|
|
||
|
@Override // io.sentry.hints.Flushable
|
||
|
public boolean waitFlush() {
|
||
|
try {
|
||
|
return this.latch.await(this.flushTimeoutMillis, TimeUnit.MILLISECONDS);
|
||
|
} catch (InterruptedException e) {
|
||
|
Thread.currentThread().interrupt();
|
||
|
this.logger.log(SentryLevel.ERROR, "Exception while awaiting for flush in BlockingFlushHint", e);
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // io.sentry.hints.DiskFlushNotification
|
||
|
public void markFlushed() {
|
||
|
this.latch.countDown();
|
||
|
}
|
||
|
}
|