1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-01-24 03:46:37 +02:00

fix:fix data race in rolling_counter used by bbr (#697)

This commit is contained in:
Taction 2021-02-17 16:40:38 +08:00 committed by GitHub
parent 5e3df708d8
commit c99b1fdbcb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -69,5 +69,7 @@ func (r *rollingCounter) Value() int64 {
}
func (r *rollingCounter) Timespan() int {
r.policy.mu.RLock()
defer r.policy.mu.RUnlock()
return r.policy.timespan()
}