Files
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

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();
}
}
}
}