Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
Mutex is similar to sync.Mutex, except usable by morph to lock the db.
Pick a unique name for each mutex your plugin requires.
A Mutex must not be copied after first use.
func (*Mutex) Lock ¶
func (m *Mutex) Lock()
Lock locks m. If the mutex is already locked by any other morph instance, including the current one, the calling goroutine blocks until the mutex can be locked.
func (*Mutex) LockWithContext ¶
LockWithContext locks m unless the context is canceled. If the mutex is already locked by any other instance, including the current one, the calling goroutine blocks until the mutex can be locked, or the context is canceled.
The mutex is locked only if a nil error is returned.
Click to show internal directories.
Click to hide internal directories.