public final class ThreadDeathWatcher extends Object
This thread starts a daemon thread to check the state of the threads being watched and to invoke their
Runnables. When there is no thread to watch (i.e. all threads are dead), the daemon thread
will terminate itself, and a new daemon thread will be started again when a new watch is added.
|Modifier and Type||Method and Description|
Waits until the thread of this watcher has no threads to watch and terminates itself.
Cancels the task scheduled via
Schedules the specified
taskto run when the specified
public static boolean awaitInactivity(long timeout, TimeUnit unit) throws InterruptedException
watch(Thread, Runnable), this operation is only useful when you want to ensure that the watcher thread is terminated after your application is shut down and there's no chance of calling
trueif and only if the watcher thread has been terminated
Copyright © 2008–2015 The Netty Project. All rights reserved.