-
Notifications
You must be signed in to change notification settings - Fork 440
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
spawn_unsafe should require that F: Send #54
Comments
The bounds were deliberately left off to provide a maximally flexible, unsafe spawning function -- i.e., to cover even the case where you wanted to work with a non- That said, the flexibility isn't needed for scoped threads, and of course does add to the overall danger of this function. Arguably, this treatment of |
An alternative might be to provide two unsafe functions instead of one, where one requires |
Given that there's not a pressing need for a version without |
PR submitted: #55. |
The
spawn_unsafe
method in Crossbeam should include a bound on the functionf: F
that it is alsoSend
. Otherwise, you may end up calling functions that access non-thread-safe things likeUnsafeCell
. This also brings the definition more in line with that ofstd::thread::spawn
. Specifically, the signature should be:The text was updated successfully, but these errors were encountered: