package org.jivesoftware.smack.util;

public class Async {
   public static Thread go(Runnable runnable) {
      Thread thread = daemonThreadFrom(runnable);
      thread.start();
      return thread;
   }

   public static Thread go(Runnable runnable, String threadName) {
      Thread thread = daemonThreadFrom(runnable);
      thread.setName(threadName);
      thread.start();
      return thread;
   }

   public static Thread daemonThreadFrom(Runnable runnable) {
      Thread thread = new Thread(runnable);
      thread.setDaemon(true);
      return thread;
   }
}
