Skip to content

proposal: math/rand: add NewLockedSource #34947

@zhangyunhao116

Description

@zhangyunhao116

May be we could add a new API called NewLockedSource in math/rand, unlike NewSource, it is safe for concurrent use by multiple goroutines. This API makes it easy to crate a concurrent-safe *math.Rand like the globalRand in math/rand.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions