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

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 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 commented Sep 3, 2015 via email

@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 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 as completed 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
Development

No branches or pull requests

4 participants