Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PartitionLocker ¶ added in v1.6.0
type PartitionLocker struct {
// contains filtered or unexported fields
}
PartitionLocker is a lock that can be used to lock different partitions at the same time.
func NewPartitionLocker ¶ added in v1.6.0
func NewPartitionLocker() *PartitionLocker
NewPartitionLocker returns a new PartitionLocker.
func (*PartitionLocker) Lock ¶ added in v1.6.0
func (p *PartitionLocker) Lock(id string)
Lock locks the lock. If the lock is locked, it waits until the lock is unlocked.
func (*PartitionLocker) Unlock ¶ added in v1.6.0
func (p *PartitionLocker) Unlock(id string)
Unlock unlocks the lock. If the lock is not locked, it panics.
type PartitionRWLocker ¶ added in v1.6.0
type PartitionRWLocker struct {
// contains filtered or unexported fields
}
PartitionRWLocker is a read-write lock that can be used to lock different partitions at the same time.
func NewPartitionRWLocker ¶ added in v1.6.0
func NewPartitionRWLocker() *PartitionRWLocker
NewPartitionRWLocker returns a new PartitionRWLocker.
func (*PartitionRWLocker) Lock ¶ added in v1.6.0
func (p *PartitionRWLocker) Lock(id string)
Lock locks the lock for writing. If the lock is locked for reading or writing, it waits until the lock is unlocked.
func (*PartitionRWLocker) RLock ¶ added in v1.6.0
func (p *PartitionRWLocker) RLock(id string)
RLock locks the lock for reading. If the lock is locked for writing, it waits until the lock is unlocked.
func (*PartitionRWLocker) RUnlock ¶ added in v1.6.0
func (p *PartitionRWLocker) RUnlock(id string)
RUnlock unlocks the lock for reading. If the lock is locked for writing or not locked for reading, it panics.
func (*PartitionRWLocker) RWMutexFor ¶ added in v1.6.0
func (p *PartitionRWLocker) RWMutexFor(id string) *RWMutex
RWMutexFor returns a new RWMutex scoped to the given id.
func (*PartitionRWLocker) Unlock ¶ added in v1.6.0
func (p *PartitionRWLocker) Unlock(id string)
Unlock unlocks the lock for writing. If the lock is locked for reading or not locked for writing, it panics.
type RWMutex ¶ added in v1.6.0
type RWMutex struct {
// contains filtered or unexported fields
}
RWMutex is a read-write lock
func (*RWMutex) Lock ¶ added in v1.6.0
func (m *RWMutex) Lock()
Lock locks the lock for writing. If the lock is locked for reading or writing, it waits until the lock is unlocked.