public static ThreadFactory threadFactory(String name, boolean daemon) { return runnable -> { Thread result = new Thread(runnable, name); result.setDaemon(daemon); return result; }; }
public Notifier(String service) { super.setDaemon(true); super.setName("DubboRedisSubscribe"); this.service = service; }
public Notifier(String service) { super.setDaemon(true); super.setName("DubboRedisSubscribe"); this.service = service; }
@Override public Thread newThread(Runnable r) { Thread thread = new Thread(r, "NetThread"); thread.setDaemon(true); return thread; } });
@Override public Thread newThread(Runnable r) { Thread thread = new Thread(r, "NetThread"); thread.setDaemon(true); return thread; } });
@Override public Thread newThread (Runnable r) { Thread thread = new Thread(r, "AsynchExecutor-Thread"); thread.setDaemon(true); return thread; } });
@Override public Thread newThread (Runnable r) { Thread thread = new Thread(r, "AsynchExecutor-Thread"); thread.setDaemon(true); return thread; } });
@Override public Thread newThread(Runnable runnable) { String name = mPrefix + mThreadNum.getAndIncrement(); Thread ret = new Thread(mGroup, runnable, name, 0); ret.setDaemon(mDaemon); return ret; }
@Override public Thread newThread(Runnable runnable) { String name = mPrefix + mThreadNum.getAndIncrement(); Thread ret = new Thread(mGroup, runnable, name, 0); ret.setDaemon(mDaemon); return ret; }
@Override public Thread newThread(Runnable runnable) { Thread thread = new Thread(runnable, "System Clock"); thread.setDaemon(true); return thread; } });
public Thread newThread(Runnable r) { Thread t = core.newThread(r); t.setDaemon(true); return t; } }
public Thread newThread(Runnable r) { String threadName = nameStart + threadNo.getAndIncrement() + nameEnd; Thread newThread = new Thread(r, threadName); newThread.setDaemon(true); if (newThread.getPriority() != Thread.NORM_PRIORITY) { newThread.setPriority(Thread.NORM_PRIORITY); } return newThread; }
@Override public Thread newThread(Runnable runnable) { Thread thread = backingThreadFactory.newThread(runnable); if (nameFormat != null) { thread.setName(format(nameFormat, count.getAndIncrement())); } if (daemon != null) { thread.setDaemon(daemon); } if (priority != null) { thread.setPriority(priority); } if (uncaughtExceptionHandler != null) { thread.setUncaughtExceptionHandler(uncaughtExceptionHandler); } return thread; } };
public Thread newThread(Runnable runnable) { Thread thread = new Thread(threadGroup, runnable,// threadGroup.getName() + "-" + namePrefix + "-" + threadNumber.getAndIncrement()); thread.setDaemon(daemon); if (thread.getPriority() != Thread.NORM_PRIORITY) { thread.setPriority(Thread.NORM_PRIORITY); } return thread; } }
public TimerThread () { files = Gdx.files; Gdx.app.addLifecycleListener(this); resume(); Thread thread = new Thread(this, "Timer"); thread.setDaemon(true); thread.start(); }
public TimerThread () { files = Gdx.files; Gdx.app.addLifecycleListener(this); resume(); Thread thread = new Thread(this, "Timer"); thread.setDaemon(true); thread.start(); }
/** Returns a new started daemon Thread running the given runnable. */ Thread newStartedThread(Runnable runnable) { Thread t = new Thread(runnable); t.setDaemon(true); t.start(); return t; }
@Override public Thread newThread(Runnable r) { Thread thread = new Thread(r); thread.setName(THREAD_NAME); thread.setPriority(THREAD_PRIORITY); thread.setDaemon(THREAD_DAEMON); thread.setUncaughtExceptionHandler(UNCAUGHT_EXCEPTION_HANDLER); return thread; } };
/** * Template method for the creation of a new {@link Thread}. * <p>The default implementation creates a new Thread for the given * {@link Runnable}, applying an appropriate thread name. * @param runnable the Runnable to execute * @see #nextThreadName() */ public Thread createThread(Runnable runnable) { Thread thread = new Thread(getThreadGroup(), runnable, nextThreadName()); thread.setPriority(getThreadPriority()); thread.setDaemon(isDaemon()); return thread; }
@CanIgnoreReturnValue static Thread startThread(Runnable runnable) { Thread thread = new Thread(runnable); thread.setDaemon(true); thread.start(); return thread; }