package com.google.android.gms.measurement.internal; import androidx.annotation.NonNull; import com.google.android.gms.common.internal.Preconditions; import java.lang.Thread; import java.util.concurrent.Callable; import java.util.concurrent.FutureTask; import java.util.concurrent.atomic.AtomicLong; /* loaded from: classes3.dex */ final class zzhh extends FutureTask implements Comparable> { final boolean zza; private final long zzb; private final String zzc; private final /* synthetic */ zzhg zzd; @Override // java.lang.Comparable public final /* synthetic */ int compareTo(@NonNull Object obj) { zzhh zzhhVar = (zzhh) obj; boolean z = this.zza; if (z != zzhhVar.zza) { return z ? -1 : 1; } long j = this.zzb; long j2 = zzhhVar.zzb; if (j < j2) { return -1; } if (j > j2) { return 1; } this.zzd.zzj().zzm().zza("Two tasks share the same index. index", Long.valueOf(this.zzb)); return 0; } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public zzhh(zzhg zzhgVar, Runnable runnable, boolean z, String str) { super(com.google.android.gms.internal.measurement.zzcv.zza().zza(runnable), null); AtomicLong atomicLong; this.zzd = zzhgVar; Preconditions.checkNotNull(str); atomicLong = zzhg.zza; long andIncrement = atomicLong.getAndIncrement(); this.zzb = andIncrement; this.zzc = str; this.zza = z; if (andIncrement == Long.MAX_VALUE) { zzhgVar.zzj().zzg().zza("Tasks index overflow"); } } /* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */ public zzhh(zzhg zzhgVar, Callable callable, boolean z, String str) { super(com.google.android.gms.internal.measurement.zzcv.zza().zza(callable)); AtomicLong atomicLong; this.zzd = zzhgVar; Preconditions.checkNotNull(str); atomicLong = zzhg.zza; long andIncrement = atomicLong.getAndIncrement(); this.zzb = andIncrement; this.zzc = str; this.zza = z; if (andIncrement == Long.MAX_VALUE) { zzhgVar.zzj().zzg().zza("Tasks index overflow"); } } @Override // java.util.concurrent.FutureTask public final void setException(Throwable th) { Thread.UncaughtExceptionHandler defaultUncaughtExceptionHandler; this.zzd.zzj().zzg().zza(this.zzc, th); if ((th instanceof zzhf) && (defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler()) != null) { defaultUncaughtExceptionHandler.uncaughtException(Thread.currentThread(), th); } super.setException(th); } }