/** Lock the thread until the queue is empty */
 public void flush(int time) {
   if (size() > 0) {
     if (Fawe.get().isMainThread()) {
       SetQueue.IMP.flush(this);
     } else {
       if (enqueue()) {
         while (!isEmpty() && getStage() == SetQueue.QueueStage.ACTIVE) {
           synchronized (this) {
             try {
               this.wait(time);
             } catch (InterruptedException e) {
               e.printStackTrace();
             }
           }
         }
       }
     }
   }
 }