other: reactor 实现

This commit is contained in:
kercylan98
2024-03-31 13:11:37 +08:00
committed by kercylan
parent ef1bb321d7
commit 1408fdcff0
25 changed files with 554 additions and 243 deletions

View File

@@ -20,7 +20,7 @@ func (c *Counter[T]) Sub() *Counter[T] {
func (c *Counter[T]) Add(delta T) {
c.rw.Lock()
c.v += delta
c.rw.RUnlock()
c.rw.Unlock()
if c.p != nil {
c.p.Add(delta)
}