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

Clean up thread::spawn #29153

Merged
merged 1 commit into from
Oct 19, 2015
Merged

Clean up thread::spawn #29153

merged 1 commit into from
Oct 19, 2015

Conversation

arcnmx
Copy link
Contributor

@arcnmx arcnmx commented Oct 19, 2015

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...

@rust-highfive
Copy link
Collaborator

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.

@arcnmx
Copy link
Contributor Author

arcnmx commented Oct 19, 2015

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...

@apasel422
Copy link
Contributor

Does this fix #29128? If so, you can add "Fixes #29128" to the commit message so that the issue is closed once this is merged.

@alexcrichton
Copy link
Member

@bors: r+ 1303687

Thanks! This was probably structured as such to support thread::scoped in the past but that's since been removed. Same part about the FnBox, it may have been for a concrete type at some point in the past but it's fine to leave out for now.

@arcnmx
Copy link
Contributor Author

arcnmx commented Oct 19, 2015

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...

bors added a commit that referenced this pull request Oct 19, 2015
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...
@bors
Copy link
Contributor

bors commented Oct 19, 2015

⌛ Testing commit 1303687 with merge 7aec917...

@bors bors merged commit 1303687 into rust-lang:master Oct 19, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants