Skip to content

Commit

Permalink
Merge pull request #1527 from tossp/add-load-for-windows
Browse files Browse the repository at this point in the history
[load][windows] Fix DATA RACE in load. Avg()
  • Loading branch information
shirou committed Sep 14, 2023
2 parents c806740 + 03d43fb commit 2fabf15
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion load/load_windows.go
Original file line number Diff line number Diff line change
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 2fabf15

Please sign in to comment.