fix comments and readme

This commit is contained in:
hdt3213
2021-06-15 01:14:41 +08:00
parent 8a04fe644a
commit ef5639f40b
3 changed files with 4 additions and 1 deletions

View File

@@ -127,6 +127,7 @@ func (locks *Locks) RUnLocks(keys ...string) {
}
}
// RWLocks locks write keys and read keys together. allow duplicate keys
func (locks *Locks) RWLocks(writeKeys []string, readKeys []string) {
keys := append(writeKeys, readKeys...)
indices := locks.toLockIndices(keys, false)
@@ -146,6 +147,7 @@ func (locks *Locks) RWLocks(writeKeys []string, readKeys []string) {
}
}
// RWUnLocks unlocks write keys and read keys together. allow duplicate keys
func (locks *Locks) RWUnLocks(writeKeys []string, readKeys []string) {
keys := append(writeKeys, readKeys...)
indices := locks.toLockIndices(keys, true)