Skip to content

Commit

Permalink
[JENKINS-36871] WIndows!?!
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenc committed Aug 5, 2016
1 parent d942165 commit 4b291b3
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/main/java/org/jenkinsci/remoting/protocol/IOHub.java
Expand Up @@ -404,20 +404,19 @@ public final void run() {
try {
while (isOpen()) {
selectorThread.setName(
String.format("IOHub#%d: Selector[keys:%d, gen:%d] / %s",
_id,
selector.keys().size(),
gen,
oldName)
"IOHub#" + _id + ": Selector[keys:" + selector.keys().size() + ", gen:" + gen + "] / " + oldName
);
try {
processScheduledTasks();
if (processRegistrations() || processInterestOps() || processSelectorTasks()) {
boolean wantSelectNow = processRegistrations();
wantSelectNow = processInterestOps() || wantSelectNow;
wantSelectNow = processSelectorTasks() || wantSelectNow;
if (wantSelectNow) {
// we did some work that is anticipated to either take some time or have likely resulted
// in an immediately ready selection key, hence we use the non-blocking form
selector.selectNow();
} else {
selector.select(1000);
selector.select(); // WINDOWS!!! Waiting the whole timeout anyway if timeout specified?!?
}
Set<SelectionKey> keys = selector.selectedKeys();
if (keys.isEmpty()) {
Expand Down

0 comments on commit 4b291b3

Please sign in to comment.