Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Commit

Permalink
Data race in ApplyConfig (#763)
Browse files Browse the repository at this point in the history
Oddly, I could not get the race detector to find this.
  • Loading branch information
Ramon Nogueira authored May 25, 2018
1 parent a658407 commit c3ed530
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions trace/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ type Config struct {
//
// Fields not provided in the given config are going to be preserved.
func ApplyConfig(cfg Config) {
c := config.Load().(*Config)
c := *config.Load().(*Config)
if cfg.DefaultSampler != nil {
c.DefaultSampler = cfg.DefaultSampler
}
if cfg.IDGenerator != nil {
c.IDGenerator = cfg.IDGenerator
}
config.Store(c)
config.Store(&c)
}

0 comments on commit c3ed530

Please sign in to comment.