code: public synchronized void shutdown() {
          if (mState == STATE_STOPPED) {
              return;
          }
          if (mState == STATE_NOT_STARTED) {
              mState = STATE_STOPPED;
              return;
          }
          mState = STATE_SHOULD_STOP;
          // Inject stop task into the queue so it knows to stop, in case we're blocked.
          mQueue.offer(STOP_TASK);
      }
docs: Indicate that this task queue thread should finish running its enqueued
  tasks and then exit. Enqueueing new tasks will result in a
  RejectedExecutionException being thrown. Join on this thread to wait for
  it to exit.