mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-30 04:10:25 +08:00
实现新的计数器算法(将时间分片, 统计更加精准)
This commit is contained in:
@@ -50,3 +50,7 @@ func (this *RWMutex) TryLock(index int) bool {
|
||||
func (this *RWMutex) TryRLock(index int) bool {
|
||||
return this.lockers[index%this.countLockers].TryRLock()
|
||||
}
|
||||
|
||||
func (this *RWMutex) RWMutex(index int) *sync.RWMutex {
|
||||
return this.lockers[index%this.countLockers]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user