修改命名

This commit is contained in:
unknown
2020-05-01 11:41:16 +08:00
parent 3f1ce8466e
commit 6487eaddbf
8 changed files with 123 additions and 148 deletions

11
ring.go
View File

@@ -43,6 +43,17 @@ func (r *Ring) GoBack() {
r.Index--
r.RingItem = r.buffer[r.Index]
}
func (r *Ring) NextW() {
r.Index++
item := r.RingItem
r.RingItem = r.buffer[r.Index]
r.RingItem.Lock()
item.UnLock()
}
func (r *Ring) NextR() {
r.RingItem.RUnlock()
r.GoNext()
}
func (r Ring) Clone() *Ring {
return &r
}