package
4.3.2+incompatible
Repository: https://github.com/qbit/client.git
Documentation: pkg.go.dev

# README

kbfssync

Types used for synchronization in KBFS. The package is named kbfssync rather than sync to avoid conflicting with the sync package.

# Functions

MakeLeveledMutex makes a mutex with the given level, backed by the given locker.
MakeLeveledRWMutex makes a reader-writer mutex with the given level, backed by the given rwLocker.
MakeLevelState returns a new LockState.
NewSemaphore returns a new Semaphore with a resource count of 0.

# Structs

LeveledMutex is a mutex with an associated level, which must be unique.
LeveledRWMutex is a reader-writer mutex with an associated level, which must be unique.
LockState holds the info regarding which level mutexes are held or not for a particular execution flow.
RepeatedWaitGroup can be used in place of a sync.WaitGroup when code may need to repeatedly wait for a set of tasks to finish.
Semaphore implements a counting semaphore; it maintains a resource count, and exposes methods for acquiring those resources -- waiting if desired -- and releasing those resources back.

# Interfaces

LeveledLocker represents an object that can be locked and unlocked with a LockState.

# Type aliases

MutexLevel is the level for a mutex, which must be unique to that mutex.