int evs = w.events();
double timeout = w.timeout();
boolean hastime = timeout < Double.POSITIVE_INFINITY;
- if((evs == 0) && !hastime) {
+ if(evs < 0) {
remove(w);
return;
}
int evs = w.events();
double timeout = w.timeout();
boolean hastime = timeout < Double.POSITIVE_INFINITY;
- if((evs == 0) && !hastime) {
- w.close();
+ if(evs < 0) {
+ submit(w::close);
return;
}
+ w.added(Driver.this);
try {
watching.put(w, ch.register(poll, evs, w));
} catch(ClosedChannelException e) {
throw(new RuntimeException(w + ": inconsistent internal state"));
if(wc == null)
throw(new IllegalStateException(w + ": not registered"));
- w.close();
+ submit(w::close);
poll.wakeup();
}
int evs = w.events();
double timeout = w.timeout();
boolean hastime = timeout < Double.POSITIVE_INFINITY;
- if((evs == 0) && !hastime) {
+ if(evs < 0) {
remove(w);
return;
}