Skip to content

Commit 5066b11

Browse files
committed
Fix non-atomic set of logging.filterLength.
One of its accesses was not atomic; tsan caught it.
1 parent 49850ea commit 5066b11

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

glog.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ func (l *loggingT) setVState(verbosity Level, filter []modulePat, setFilter bool
470470
// Turn verbosity off so V will not fire while we are in transition.
471471
logging.verbosity.set(0)
472472
// Ditto for filter length.
473-
logging.filterLength = 0
473+
atomic.StoreInt32(&logging.filterLength, 0)
474474

475475
// Set the new filters and wipe the pc->Level map if the filter has changed.
476476
if setFilter {

0 commit comments

Comments
 (0)