- 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
67 lines
1.6 KiB
Java
67 lines
1.6 KiB
Java
package csdk.glucustomersupport.util;
|
|
|
|
import java.util.LinkedList;
|
|
import java.util.Queue;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
/* loaded from: classes4.dex */
|
|
public class GluTaskQueue {
|
|
private Queue<QueueObject> mQueue = new LinkedList();
|
|
private AtomicBoolean mIsRunning = new AtomicBoolean();
|
|
|
|
public class QueueObject {
|
|
public boolean runOnUiThread;
|
|
public Runnable runnable;
|
|
|
|
private QueueObject() {
|
|
}
|
|
}
|
|
|
|
public void suspend() {
|
|
this.mIsRunning.set(false);
|
|
}
|
|
|
|
public void resume() {
|
|
this.mIsRunning.set(true);
|
|
}
|
|
|
|
public void run(Runnable runnable) {
|
|
run(runnable, false);
|
|
}
|
|
|
|
public void runOnUiThread(Runnable runnable) {
|
|
run(runnable, true);
|
|
}
|
|
|
|
private void run(Runnable runnable, boolean z) {
|
|
QueueObject queueObject = new QueueObject();
|
|
queueObject.runnable = runnable;
|
|
queueObject.runOnUiThread = z;
|
|
synchronized (this) {
|
|
this.mQueue.add(queueObject);
|
|
}
|
|
run();
|
|
}
|
|
|
|
private void run() {
|
|
QueueObject poll;
|
|
while (this.mIsRunning.get()) {
|
|
synchronized (this) {
|
|
try {
|
|
poll = !this.mQueue.isEmpty() ? this.mQueue.poll() : null;
|
|
} catch (Throwable th) {
|
|
throw th;
|
|
}
|
|
}
|
|
if (poll == null) {
|
|
return;
|
|
}
|
|
if (poll.runOnUiThread) {
|
|
GluUtil.runOnUIThread(poll.runnable);
|
|
} else {
|
|
poll.runnable.run();
|
|
}
|
|
}
|
|
}
|
|
}
|