code: public void run() {
          Runnable r = null;
          while (true) {
              // Try to drain the maximum capacity of thread-local items, checking
              // whether any were available
              if (workQueue.drainTo(internalQueue, threadLocalItems) == 0) {
                  // block until a work item is available
                  try {
                      internalQueue.offer(workQueue.take());
                  } catch (InterruptedException ie) {
                      throw new Error(ie);
                  }
              }
              // Execute all of the thread-local items
              while ((r = internalQueue.poll()) != null)
                  r.run();
          }
      }
docs: Continuously dequeues {@code Runnable} instances from the work queue and
  execute them.