-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Clean up thread::spawn #29153
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
Clean up thread::spawn #29153
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @nikomatsakis (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 the contribution instructions for more information. |
Oh wait, the FnBox was probably to avoid code bloat... Should probably add that back in? Though the closure is already generic over the return type anyway... |
Cool, if it turns out the indirection was intentional we can clean that up too, not quite sure whether the monomorphization or the dual box allocation is worse... |
Fixes #29128 Most of the weird lifetime things and `inner` stuff seems like leftover cruft from `thread::scoped`. Should `JoinInner` just be removed/merged with `JoinHandle`? Also is it okay to remove the `FnBox`? I'm not really sure why there were two allocations there...
Fixes #29128
Most of the weird lifetime things and
inner
stuff seems like leftover cruft fromthread::scoped
. ShouldJoinInner
just be removed/merged withJoinHandle
?Also is it okay to remove the
FnBox
? I'm not really sure why there were two allocations there...