Added isShutdown() query

This commit is contained in:
nathan 2018-01-15 16:02:09 +01:00
parent 758a93d1b9
commit ed1fdf4085

View File

@ -79,6 +79,7 @@ class EndPoint {
protected final Class<? extends EndPoint> type;
protected final Object shutdownInProgress = new Object();
private volatile boolean isShutdown = false;
// the eventLoop groups are used to track and manage the event loops for startup/shutdown
private final List<EventLoopGroup> eventLoopGroups = new ArrayList<EventLoopGroup>(8);
@ -320,6 +321,8 @@ class EndPoint {
// we also want to stop the thread group
threadGroup.interrupt();
isShutdown = true;
}
// tell the blocked "bind" method that it may continue (and exit)
@ -339,6 +342,16 @@ class EndPoint {
}
}
/**
* @return true if we have already shutdown, false otherwise
*/
public final
boolean isShutdown() {
synchronized (shutdownInProgress) {
return isShutdown;
}
}
@Override
public
String toString() {