code: private static Future<?> spawn(final int priority, final Runnable threadProc) {
          return threadPool.submit(new Runnable() {
  
              @Override
              public void run() {
                  Thread current = Thread.currentThread();
                  int defaultPriority = current.getPriority();
  
                  try {
                      current.setPriority(priority);
  
                      /*
                       * We yield to give the foreground process a chance to run.
                       * This also means that the new priority takes effect RIGHT
                       * AWAY, not after the next blocking call or quantum
                       * timeout.
                       */
                      Thread.yield();
  
                      try {
                          threadProc.run();
                      } catch (Exception e) {
                          logException(TAG, e);
                      }
                  } finally {
                      current.setPriority(defaultPriority);
                  }
  
              }
  
          });
      }
docs: Execute a Runnable on a thread pool thread
  
  @param priority
  The thread priority. Be careful with this! <blockquote>
  <b>Note:</b> Use Thread.MIN_PRIORITY..Thread.MAX_PRIORITY
  (1..10), <b>not</b> the Process/Linux -20..19 range!
  </blockquote>
  @param threadProc
  The code to run. It doesn't matter if this code never returns
  - by using spawn (and, hence the thread pool) there is at
  least a chance that you will be reusing a thread, thus saving
  teardown/startup costs.
  
  @return A Future<?> that lets you wait for thread completion, if
  necessary