From c29d4fc59eefefa71526daf030844a4b449c91b9 Mon Sep 17 00:00:00 2001 From: Bhasker Hariharan Date: Wed, 18 Mar 2020 06:35:34 -0700 Subject: Automated rollback of changelist 301501607 PiperOrigin-RevId: 301578043 --- pkg/rand/rand_linux.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'pkg/rand') diff --git a/pkg/rand/rand_linux.go b/pkg/rand/rand_linux.go index 1aec96e2b..0bdad5fad 100644 --- a/pkg/rand/rand_linux.go +++ b/pkg/rand/rand_linux.go @@ -45,18 +45,12 @@ func (r *reader) Read(p []byte) (int, error) { return rand.Read(p) } -// mu protects the global Reader below. -var mu sync.Mutex - // Reader is the default reader. var Reader io.Reader = &reader{} // Read reads from the default reader. func Read(b []byte) (int, error) { - mu.Lock() - n, err := io.ReadFull(Reader, b) - mu.Unlock() - return n, err + return io.ReadFull(Reader, b) } // Init can be called to make sure /dev/urandom is pre-opened on kernels that -- cgit v1.2.3