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

math/rand: default Source safe for concurrent use #12471

Closed
awilliams opened this issue Sep 3, 2015 · 3 comments
Closed

math/rand: default Source safe for concurrent use #12471

awilliams opened this issue Sep 3, 2015 · 3 comments

Comments

@awilliams
Copy link

@awilliams awilliams commented Sep 3, 2015

The math/rand documentation states:

The default Source is safe for concurrent use by multiple goroutines.

This confused me because I thought the "default Source" referred to Source returned by the NewSource function. Instead, it refers to the protected internal Source used by the top-level functions.

@bradfitz bradfitz added this to the Go1.6 milestone Sep 3, 2015
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Sep 3, 2015

Agreed. We should clarify that the Source (internally: rngSource) returned by NewSource is not safe for concurrent use.

@minux
Copy link
Member

@minux minux commented Sep 3, 2015

@minux minux changed the title doc: default Source safe for concurrent use math/rand: default Source safe for concurrent use Sep 3, 2015
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Sep 3, 2015

True. Yeah, there's not really anything to do here.

Feel free to re-open if you disagree.

@bradfitz bradfitz closed this Sep 3, 2015
@golang golang locked and limited conversation to collaborators Sep 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.