Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Locker ¶
type Locker struct {
// contains filtered or unexported fields
}
Locker is a spinlock-based implementation of sync.Locker.
func (*Locker) Lock ¶
func (l *Locker) Lock()
Lock waits until the locker with be unlocked (if it is not) and then locks it.
func (*Locker) LockDo ¶
func (l *Locker) LockDo(fn func())
LockDo is just a wrapper for `Lock` + `Unlock`. It locks the locker, runs the function `fn` and then unlocks the locker.
func (*Locker) SetUnlocked ¶
func (l *Locker) SetUnlocked()
SetUnlocked resets the state of the locker.
Use case: if you copy an object, you may want to reset this value.
Click to show internal directories.
Click to hide internal directories.