public void addToExecute(final Runnable task) {
    lock.writeLock().lock();
    try {
      waitTasks.add(task);
    } catch (Exception e) {
      // This try catch block enable to free the lock in case of any unexpected error.
    }
    lock.writeLock().unlock();
  }
Add the given {@link Runnable runnable} to the list of planned executions. 
@param task the task to add.
@see #execute()
jme3-desktop/src/main/java/com/jme3/system/AWTTaskExecutor.java