mirror of
https://github.com/Pinball3D/Rabbit-R1.git
synced 2025-01-09 13:43:22 +00:00
37 lines
1.1 KiB
Java
37 lines
1.1 KiB
Java
package io.sentry.util.thread;
|
|
|
|
import io.sentry.protocol.SentryThread;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public final class MainThreadChecker implements IMainThreadChecker {
|
|
private static final long mainThreadId = Thread.currentThread().getId();
|
|
private static final MainThreadChecker instance = new MainThreadChecker();
|
|
|
|
public static MainThreadChecker getInstance() {
|
|
return instance;
|
|
}
|
|
|
|
@Override // io.sentry.util.thread.IMainThreadChecker
|
|
public boolean isMainThread(long j) {
|
|
return mainThreadId == j;
|
|
}
|
|
|
|
private MainThreadChecker() {
|
|
}
|
|
|
|
@Override // io.sentry.util.thread.IMainThreadChecker
|
|
public boolean isMainThread(Thread thread) {
|
|
return isMainThread(thread.getId());
|
|
}
|
|
|
|
@Override // io.sentry.util.thread.IMainThreadChecker
|
|
public boolean isMainThread() {
|
|
return isMainThread(Thread.currentThread());
|
|
}
|
|
|
|
@Override // io.sentry.util.thread.IMainThreadChecker
|
|
public boolean isMainThread(SentryThread sentryThread) {
|
|
Long id = sentryThread.getId();
|
|
return id != null && isMainThread(id.longValue());
|
|
}
|
|
}
|