-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Update intro.md to fix thread spawning example #22298
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
Conversation
Fixed example threaded code in intro doc never printing results. Threads were created with Thread::spawn instead of Thread::scoped.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @huonw (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. The way Github handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see CONTRIBUTING.md for more information. |
Thank you! |
I am not sure if this is the correct way to fix this, since this changes the code to be sequential (each |
Ahh, this is true. This needs to change to use |
@steveklabnik fwiw you don't need a guards variable in that code, might be easier to just add a hint to collect and remove the let, not sure what syntax you've introduced in terms of |
IIRC, I wanted to make it a little more clear about when |
r? @steveklabnik (transferring reviewership) |
Fixed example threaded code in intro doc never printing results. Threads were created with Thread::spawn instead of Thread::scoped.
@diamondman are you interested in updating this PR? If so, please add "Closes #22419" to the new commit message. If you're not, just let me know, and i'll fix it. thanks! |
@steveklabnik I did not see updates for this until today somehow. I will close this and attempt to fix the example better using the correct locking structures. Thanks everyone for suggestions. |
Sorry @steveklabnik but I am not sure how I am supposed to edit the commit message from github to correctly close the issue. I know how to make a commit from the command line that closes an issue but I have no changes to commit. Please advise so I do not make further pointless changes guessing. |
No worries! A few things:
|
Ok, I knew how to amend in the command line but I was worried that trying to push a change to the commit would require a force push and was not sure how this would work cross projects. I will try pushing that up. Thanks. |
I pushed up the amended commit message to my fork and the issue you created shows a link to the updated commit.
|
Oh hey @diamondman , sorry I missed this. Two things:
With the |
I have the patch ready. I am trying to test it but make check is yelling that it can not find valgrind (it is installed). I will make the new pull request as soon as I know it tests fine. |
Hm, it shouldn't error on that, but if you want a quicker test, you can run |
Fixed example threaded code in intro doc never printing results. Threads were created with Thread::spawn instead of Thread::scoped.