-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Improve documentation on thread::park returning spuriously #26475
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
Comments
I believe that this is an intentional aspect of the @aturon would know for certain, though. |
Marking with libs until we know for sure. |
Yes, it is intended to allow spurious wakeups in the future, with no way to detect them -- part of the point of this API is to impose the narrowest possible requirements on the underlying system (so as to use Futexes, etc, eventually). |
(See the park method in http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/locks/LockSupport.html, which is the inspiration.) |
That's a good page.
The second sentence in particular gives some clarity. |
Fixes #26475 I'm not sure this is enough, really, but I'm not totally clear on what specific information would be valuable here. In the original issue, the Java page was pretty decent, but now I can't think of a different way to word it, and copying their prose is of course not acceptable. thoughts @alexcrichton @aturon @aidanhs ?
I'm aware that currently there is no way a thread can return from park spuriously, but this is an implementation detail - when/if the new implementation happens it will break anything trying to use
park
because there was previously no way to use it correctly.(it may be that I've just missed how to do this, in which case I'd consider it a documentation bug and can make a PR)
The text was updated successfully, but these errors were encountered: