]> Cypherpunks repositories - gostls13.git/commit
crypto/rand: fix race on r.used
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 6 May 2022 14:50:19 +0000 (16:50 +0200)
committerGopher Robot <gobot@golang.org>
Fri, 6 May 2022 17:41:30 +0000 (17:41 +0000)
commit091e913414794d9176861b1ffcdbcfdc2d742af3
tree3bbb4a2ff84e7308405abb621041b338e0c7d713
parent2049649e8bf582bd1ee19d2e565e4e3bc3f466ea
crypto/rand: fix race on r.used

This race is benign, but it still trips up the race detector, so turn
this into an atomic read.

Fixes #52739.

Change-Id: Ib53362286b456513c8c69d6d2d73c6c90ec095f3
Reviewed-on: https://go-review.googlesource.com/c/go/+/404475
Auto-Submit: Jason Donenfeld <Jason@zx2c4.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Jason Donenfeld <Jason@zx2c4.com>
src/crypto/rand/rand_unix.go