package com.dowse.camera.client.data;

import java.util.LinkedList;

/* loaded from: ds_camera_client-2.0.6-23030810.aar:classes.jar:com/dowse/camera/client/data/DSQueue.class */
public class DSQueue {
    private static final Object lockObjectQueue = new Object();
    private LinkedList list = new LinkedList();

    public void clear() {
        synchronized (lockObjectQueue) {
            this.list.clear();
        }
    }

    public boolean isEmpty() {
        return this.list.isEmpty();
    }

    public void add(Object o) {
        synchronized (lockObjectQueue) {
            this.list.addLast(o);
        }
    }

    public Object get() {
        synchronized (lockObjectQueue) {
            if (!this.list.isEmpty()) {
                return this.list.removeFirst();
            }
            return null;
        }
    }

    public int length() {
        int size;
        synchronized (lockObjectQueue) {
            size = this.list.size();
        }
        return size;
    }

    public Object peek() {
        return this.list.getFirst();
    }
}
