Skip to content

Is it safe to .clone() across threads? #124

Answered by weiznich
jjangga0214 asked this question in Q&A
Discussion options

You must be logged in to vote

To cite from the relevant documentation

This struct can be cloned and transferred across thread boundaries and uses reference counting for its internal state.

So yes, it's safe to use it in that way. (Otherwise either the implementation would be unsound or the compiler would complain)

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@jjangga0214
Comment options

@weiznich
Comment options

@jjangga0214
Comment options

Answer selected by jjangga0214
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants