Added isShutdown() query
This commit is contained in:
parent
758a93d1b9
commit
ed1fdf4085
@ -79,6 +79,7 @@ class EndPoint {
|
|||||||
protected final Class<? extends EndPoint> type;
|
protected final Class<? extends EndPoint> type;
|
||||||
|
|
||||||
protected final Object shutdownInProgress = new Object();
|
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
|
// the eventLoop groups are used to track and manage the event loops for startup/shutdown
|
||||||
private final List<EventLoopGroup> eventLoopGroups = new ArrayList<EventLoopGroup>(8);
|
private final List<EventLoopGroup> eventLoopGroups = new ArrayList<EventLoopGroup>(8);
|
||||||
@ -320,6 +321,8 @@ class EndPoint {
|
|||||||
|
|
||||||
// we also want to stop the thread group
|
// we also want to stop the thread group
|
||||||
threadGroup.interrupt();
|
threadGroup.interrupt();
|
||||||
|
|
||||||
|
isShutdown = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// tell the blocked "bind" method that it may continue (and exit)
|
// 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
|
@Override
|
||||||
public
|
public
|
||||||
String toString() {
|
String toString() {
|
||||||
|
Loading…
Reference in New Issue
Block a user