Skip to content
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

"How to join a thread with a timeout in Rust?" is not valid Rust #2001

Open
Chasethechicken opened this issue Jan 13, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@Chasethechicken
Copy link

  1. A link to the code with a problem: https://onelinerhub.com/rust/how-to-join-a-thread-with-a-timeout-in-rust
  2. Short explanation of the problem in the solution
    The code explains, that join_timeout can be used to join a thread with a timeout.
    This is false, as can be seen in the linked docs: https://doc.rust-lang.org/std/thread/struct.Thread.html#method.join_timeout and additionally https://doc.rust-lang.org/std/thread/struct.JoinHandle.html
    A JoinHandle has no function join_timeout.
  3. Proposal of changes (if any):
    Remove the example.
    Alternatively implement something using is_finished instead, to check if the thread has finished.
@Chasethechicken Chasethechicken added the bug Something isn't working label Jan 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant