Skip to content

Commit

Permalink
[load][windows] Fix DATA RACE in load. Avg()
Browse files Browse the repository at this point in the history
fixed #1526
  • Loading branch information
tossp committed Sep 13, 2023
1 parent c806740 commit 03d43fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion load/load_windows.go
Expand Up @@ -45,8 +45,8 @@ func loadAvgGoroutine(ctx context.Context) {

f := func() {
currentLoad, err = counter.GetValue()
loadErr = err
loadAvgMutex.Lock()
loadErr = err
loadAvg1M = loadAvg1M*loadAvgFactor1M + currentLoad*(1-loadAvgFactor1M)
loadAvg5M = loadAvg5M*loadAvgFactor5M + currentLoad*(1-loadAvgFactor5M)
loadAvg15M = loadAvg15M*loadAvgFactor15M + currentLoad*(1-loadAvgFactor15M)
Expand Down

0 comments on commit 03d43fb

Please sign in to comment.