Discover Packages
github.com/mattermost/morph
drivers
postgres
package
Version:
v1.1.0
Opens a new window with list of versions in this module.
Published: Nov 3, 2023
License: MIT
Opens a new window with license information.
Imports: 13
Opens a new window with list of imports.
Imported by: 16
Opens a new window with list of known importers.
Documentation
Documentation
¶
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.
NewMutex creates a mutex with the given key name.
returns error if key is empty.
Lock 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.
Unlock unlocks m. It is a run-time error if m is not locked on entry to Unlock.
Just like sync.Mutex, a locked Lock is not associated with a particular goroutine or a process.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.