-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CompletionListenerFuture wakeup for multiple threads, protect against spurious wakeup #320
Comments
👍 it should indeed be notifyAll. |
… to trigger problems more reliable, tracked by jsr107/jsr107spec#320
Pull request is ready. Another Pull Request against the TCK is extending the tests to better check the current behavior so we don't introduce an regression. A test for the bug is also included but optional. See PR comment. |
The PR on the CompletionListenerFuture also does minor corrections in the JavaDoc, since the existing one was stating that a value is returned. |
Closed with PR 371 |
From CompletionListenerFuture:
This is notifying only one thread upon completion, all others block indefinitely.
Solution: notify() -> notifyAll()
From: #348
The following code fails to deal with spurious wakeup. It is allowed that the thread is notified without a reason. To deal with this situation, the if(!completed) should be while(!completed). Of course the remaining timeout needs to be corrected.
The text was updated successfully, but these errors were encountered: