Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mutex ¶
type Mutex struct {
// contains filtered or unexported fields
}
Mutex is a file-based mutex intended to facilitate cross-process synchronization. Locks acquired by Mutex are advisory, so all participating processes must use advisory lock features in order to co-operate. Locks acquired by Mutex are not inherited by child processes and are automatically released when the process exits.
It is not intended for in-process synchronization, and should not be shared between goroutines without being appropriately guarded by a sync.Mutex.
func (*Mutex) Lock ¶
Lock attempts to lock the file for reading & writing. It blocks until the lock is acquired, or an error happens. If the file is already locked for reading, it will upgrade the lock to a read-write lock.