Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Versioned ¶ added in v0.2.0
type Versioned[T any] struct { Val T // contains filtered or unexported fields }
Versioned[T] is a linearizable register storing a value of type T. Each update to the value changes its unique (but not necessarily ordered) version. Spurious version changes are possible, i.e., the version may change even if the value hasn't.
Like a sync.Mutex, Versioned should not be copied.
func (*Versioned[T]) Lock ¶ added in v0.2.0
func (v *Versioned[T]) Lock()
Lock acquires the write lock.
func (*Versioned[T]) RLock ¶ added in v0.2.0
RLock waits until the current version is different than the passed-in version, and then acquires the read lock and returns the new version.
Click to show internal directories.
Click to hide internal directories.