sync

package
v1.6.0-preview.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2023 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type First

type First struct {
	// contains filtered or unexported fields
}

func (*First) First

func (f *First) First() bool

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.

func (*RWMutex) RLock added in v1.6.0

func (m *RWMutex) RLock()

RLock locks the lock for reading. If the lock is locked for writing, it waits until the lock is unlocked.

func (*RWMutex) RUnlock added in v1.6.0

func (m *RWMutex) RUnlock()

func (*RWMutex) Unlock added in v1.6.0

func (m *RWMutex) Unlock()

Unlock unlocks the lock for writing. If the lock is locked for reading or not locked for writing, it panics.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL