@@ -0,0 +1,913 @@
+package com.team254.lib.util;%0A%0Aimport java.util.concurrent.ArrayBlockingQueue;%0A%0Apublic class TaskQueue implements Runnable %7B%0A  public ArrayBlockingQueue%3CRunnable%3E bq;%0A  Thread thread;%0A  private boolean running = true;%0A  %0A  public TaskQueue(int size) %7B%0A    bq = new ArrayBlockingQueue%3CRunnable%3E(size);%0A  %7D%0A  %0A  public void start() %7B%0A    running = true;%0A    if (thread == null %7C%7C !thread.isAlive()) %7B%0A      thread = new Thread(this);%0A    %7D%0A    thread.start();%0A    %0A  %7D%0A  %0A  public void stop() %7B%0A    running = false;%0A  %7D%0A%0A  @Override%0A  public void run() %7B%0A    while (running) %7B%0A      Runnable runnable;%0A      try %7B%0A        runnable = bq.take();%0A        if (runnable != null) %7B%0A          runnable.run();%0A        %7D%0A      %7D catch (InterruptedException e) %7B%0A        // TODO Auto-generated catch block%0A        e.printStackTrace();%0A      %7D%0A    %7D%0A  %7D%0A%0A  public boolean addTask(Runnable r) %7B%0A    return bq.offer(r);%0A  %7D%0A %0A%7D%0A

Add TaskQueue, a concurrent Runnable processor