Documentation ¶
Index ¶
- func Lock(fn func(), m ...Mutex)
- func LockRet[T any](fn func() T, m ...Mutex) T
- func LockRetErr[T any](fn func() (T, error), m ...Mutex) (T, error)
- func RLock(fn func(), m ...RWMutex)
- func RLockRet[T any](fn func() T, m ...RWMutex) T
- func RLockRetErr[T any](fn func() (T, error), m ...RWMutex) (T, error)
- type Mutex
- type RWMutex
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Lock ¶
func Lock(fn func(), m ...Mutex)
Lock locks one or more mutexes for writing and calls the given function. The mutexes are locked in a deterministic order to avoid deadlocks.
func LockRet ¶
LockRet locks one or more mutexes for writing and calls the given function, returning a value.
func LockRetErr ¶
LockRetErr locks one or more mutexes for writing and calls the given function, returning a value and an error.
func RLock ¶
func RLock(fn func(), m ...RWMutex)
RLock locks one or more mutexes for reading and calls the given function. The mutexes are locked in a deterministic order to avoid deadlocks.
Types ¶
Click to show internal directories.
Click to hide internal directories.