- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
45 lines
1.3 KiB
Java
45 lines
1.3 KiB
Java
package com.helpshift.concurrency;
|
|
|
|
import com.helpshift.log.HSLogger;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public class NotifyingRunnable implements Runnable {
|
|
public final Runnable runnable;
|
|
public final Object syncLock = new Object();
|
|
public AtomicBoolean isFinished = new AtomicBoolean(false);
|
|
|
|
public NotifyingRunnable(Runnable runnable) {
|
|
this.runnable = runnable;
|
|
}
|
|
|
|
public void waitForCompletion() {
|
|
synchronized (this.syncLock) {
|
|
while (!this.isFinished.get()) {
|
|
try {
|
|
this.syncLock.wait();
|
|
} catch (InterruptedException e) {
|
|
HSLogger.d("NotifyingRunnable", "Exception in NotifyingRunnable", e);
|
|
Thread.currentThread().interrupt();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public void run() {
|
|
synchronized (this.syncLock) {
|
|
try {
|
|
try {
|
|
this.runnable.run();
|
|
} finally {
|
|
this.isFinished.set(true);
|
|
this.syncLock.notifyAll();
|
|
}
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
}
|
|
}
|