chore(deps): bump github/codeql-action from 3.35.3 to 4.35.2 in the github-actions group (#143)
flock implements a thread-safe file lock.
flock
It also includes a non-blocking TryLock() function to allow locking without blocking execution.
TryLock()
go get -u github.com/gofrs/flock
import "github.com/gofrs/flock" fileLock := flock.New("/var/lock/go-lock.lock") locked, err := fileLock.TryLock() if err != nil { // handle locking error } if locked { // do work fileLock.Unlock() }
For more detailed usage information take a look at the package API docs on GoDoc.
flock is released under the BSD 3-Clause License. See the LICENSE file for more details.
LICENSE
This project was originally github.com/theckman/go-flock, it was transferred to Gofrs by the original author Tim Heckman .
github.com/theckman/go-flock
提供文件锁定机制,用于管理对共享文件的并发访问,防止数据竞争。
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802047560号
flock
flockimplements a thread-safe file lock.It also includes a non-blocking
TryLock()function to allow locking without blocking execution.Installation
Usage
For more detailed usage information take a look at the package API docs on GoDoc.
License
flockis released under the BSD 3-Clause License. See theLICENSEfile for more details.Project History
This project was originally
github.com/theckman/go-flock, it was transferred to Gofrs by the original author Tim Heckman .