]> Cypherpunks.ru repositories - gostls13.git/commit
[release-branch.go1.9] log: fix data race on log.Output
authorhagen1778 <hagen1778@gmail.com>
Tue, 19 Sep 2017 17:28:11 +0000 (20:28 +0300)
committerRuss Cox <rsc@golang.org>
Wed, 25 Oct 2017 20:22:58 +0000 (20:22 +0000)
commitbd34e74134645b7a7109dbf0361eb1ceb1c3d1ba
tree75700ad7599801c9984071d6aba235d118a8e4b3
parent0b55d8dbfc6892433b0329b3834d50f72d90db58
[release-branch.go1.9] 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>
Reviewed-on: https://go-review.googlesource.com/70976
Run-TryBot: Russ Cox <rsc@golang.org>
src/log/log.go
src/log/log_test.go