Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileLock ¶
type FileLock interface { // Lock try locking file, return err if fails. Lock() error // Unlock unlock file lock, if fail return err Unlock() error }
FileLock represents file lock
func NewFileLock ¶
NewFileLock create new file lock instance
type SpinLock ¶
type SpinLock struct {
// contains filtered or unexported fields
}
SpinLock implements sync/Locker, default 0 indicates an unlocked spinLock.
func (*SpinLock) Lock ¶
func (sl *SpinLock) Lock()
Lock locks spinLock. If the lock is locked before, the caller will be blocked until unlocked.
Click to show internal directories.
Click to hide internal directories.