GameTask task;
GameTask task = queue.poll();
    public void execute() {        GameTask task;        do {            task = queue.poll();            if (task == null) return;            while (task.isCancelled()) {                task = queue.poll();                if (task == null) return;            }            task.invoke();        } while ((executeAll) && ((task = queue.poll()) != null));    }