sync

package
v0.0.0-...-27647ab Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultLock

type DefaultLock struct {
	sync.Locker
}

func (DefaultLock) Lock

func (n DefaultLock) Lock()

func (DefaultLock) Unlock

func (n DefaultLock) Unlock()

type DumbLock

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

func (*DumbLock) Lock

func (l *DumbLock) Lock()

func (*DumbLock) TryLock

func (l *DumbLock) TryLock() bool

func (*DumbLock) Unlock

func (l *DumbLock) Unlock()

type Lazy

type Lazy[T any] struct {
	// contains filtered or unexported fields
}

func (*Lazy[T]) Get

func (va *Lazy[T]) Get(fn func() T) T

func (*Lazy[T]) Set

func (va *Lazy[T]) Set(v T) bool

type LazyFn

type LazyFn[T any] struct {
	Fn func() T
	// contains filtered or unexported fields
}

func NewLazyFn

func NewLazyFn[T any](fn func() T) *LazyFn[T]

func (*LazyFn[T]) Get

func (l *LazyFn[T]) Get() T

func (*LazyFn[T]) Peek

func (l *LazyFn[T]) Peek() (T, bool)

func (*LazyFn[T]) Set

func (l *LazyFn[T]) Set(v T) T

type NopLock

type NopLock struct{}

func (NopLock) Lock

func (n NopLock) Lock()

func (NopLock) Unlock

func (n NopLock) Unlock()

type OMutex

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

func (*OMutex) Lock

func (l *OMutex) Lock(o any) int

func (*OMutex) State

func (l *OMutex) State() OMutexState

func (*OMutex) TryLock

func (l *OMutex) TryLock(o any) int

func (*OMutex) Unlock

func (l *OMutex) Unlock(o any) int

type OMutexIncorrectOwnerError

type OMutexIncorrectOwnerError struct{}

type OMutexState

type OMutexState struct {
	Owner   any
	Depth   int
	Waiters int
}

type Ref

type Ref[T any] interface {
	Acquire() bt.Optional[T]
	Release()

	AddCallback(cb func(r Ref[T], v T))
}

func NewRef

func NewRef[T any](v T) Ref[T]

func NewSyncRef

func NewSyncRef[T any](v T) Ref[T]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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