]> Cypherpunks repositories - gostls13.git/commit
log: fix data race on log.Output
authorhagen1778 <hagen1778@gmail.com>
Tue, 19 Sep 2017 17:28:11 +0000 (20:28 +0300)
committerJoe Tsai <thebrokentoaster@gmail.com>
Tue, 19 Sep 2017 20:35:24 +0000 (20:35 +0000)
commitd1731f8cbc1adde72a2b2e7513b6ca73476c7f0d
treef95aab838a9c08f9ea6f4836ef7828402525ed3f
parent7c8a9615c0512815060489a491265c275127b79f
log: fix data race on log.Output

There was unprotected access to Logger.flag in log.Output which
could lead to data race in cases when log.SetFlags called simultaneously.
For example, "hot" switching on/off debug-mode for Logger by log.SetFlags
while application still writing logs.

Fixes #21935

Change-Id: I36be25f23cad44cde62ed1af28a30d276400e1b8
Reviewed-on: https://go-review.googlesource.com/64710
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/log/log.go
src/log/log_test.go