code: public void execute(Runnable task, long timeoutMillis) throws RejectedExecutionException {
          if (task == null) {
              throw new NullPointerException("Cannot accept null task");
          }
          synchronized (this) {
              if (mState != STATE_RUNNING && mState != STATE_NOT_STARTED) {
                  throw new RejectedExecutionException("Task queue is shutdown");
              }
          }
          try {
              if (!mQueue.offer(task, timeoutMillis, TimeUnit.MILLISECONDS)) {
                  throw new RejectedExecutionException("Unable to enqueue task after waiting " +
                                                       timeoutMillis + " milliseconds");
              }
          } catch (InterruptedException e) {
              throw new RejectedExecutionException(e);
          }
      }
docs: Enqueue a task to run.
  
  @param task task to enqueue
  @param timeoutMillis maximum time to wait for queue to have an available slot
  @throws RejectedExecutionException if wait interrupted, timeout expires,
  or shutdown has been called