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

Why is T required to be Send? #3

Closed
thk1 opened this issue Oct 15, 2016 · 1 comment
Closed

Why is T required to be Send? #3

thk1 opened this issue Oct 15, 2016 · 1 comment

Comments

@thk1
Copy link

thk1 commented Oct 15, 2016

Why is T required to be Send if the wrapped value is only accessible within the same thread it has been created from?

pub struct ThreadLocal<T: ?Sized + Send> { /* fields omitted */ }
@Amanieu
Copy link
Owner

Amanieu commented Oct 15, 2016

Because it may be dropped by a different thread. All thread-local values are dropped when the ThreadLocal is destroyed.

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

No branches or pull requests

2 participants