Merge pull request #512 from bgrozev/fix-smack-reactor-select

fix: Correctly handle the case when the action due time is 0.
This commit is contained in:
Florian Schmaus 2022-02-06 17:47:50 +01:00 committed by GitHub
commit 4e715a35e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 5 deletions

View File

@ -221,11 +221,10 @@ public class SmackReactor {
selectWait = 0; selectWait = 0;
} else { } else {
selectWait = nextScheduledAction.getTimeToDueMillis(); selectWait = nextScheduledAction.getTimeToDueMillis();
} if (selectWait <= 0) {
// A scheduled action was just released and became ready to execute.
if (selectWait < 0) { return;
// A scheduled action was just released and became ready to execute. }
return;
} }
// Before we call select, we handle the pending the interest Ops. This will not block since no other // Before we call select, we handle the pending the interest Ops. This will not block since no other