proxy.golang.org : github.com/trufflesecurity/touchfile
Package touchfile provides a mechanism to create, lock, and manage a touch file for coordinating access between different processes. Mutexes are used to coordinate between goroutines. Touch files are used to coordinate between different processes. Because touch files aren't truly atomic, this package uses flock to acquire a voluntary lock on the file. This package creates a temporary file (unless otherwise specified) to use as a lock file. A voluntary lock is acquired on the file using the flock system call. WARNING: Like all go code related to concurrency, this module is NOT reentrant. And because go doesn't have a way to detect reentrancy, it's up to the caller to avoid deadlocks caused by concurrent access to this module. WARNING: Because flock is used, this module may not be compatible with all file systems (notably networked file systems like NFS). Example usage: Basic usage: Global lock using the program binary: Using WithLock for a critical section:
Registry
-
Source
- Documentation
- JSON
- codemeta.json
purl: pkg:golang/github.com/trufflesecurity/touchfile
License: Apache-2.0
Latest release: over 1 year ago
First release: over 1 year ago
Namespace: github.com/trufflesecurity
Stars: 0 on GitHub
Forks: 0 on GitHub
Docker dependents: 1
Docker downloads: 17,428
See more repository details: repos.ecosyste.ms
Last synced: 2 months ago