Java tutorial
//package com.java2s; import java.util.concurrent.CopyOnWriteArrayList; public class Main { private static CopyOnWriteArrayList<Runnable> glRunnables = new CopyOnWriteArrayList<Runnable>(); public static void runGlRunnables() { // TODO for (Runnable runnable : glRunnables) { runnable.run(); } glRunnables.clear(); } }