MCPcopy Index your code
hub / github.com/GoEdgeLab/EdgeNode / TryLock

Method TryLock

internal/utils/fs/locker.go:22–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20}
21
22func (this *Locker) TryLock() (ok bool, err error) {
23 if this.fp == nil {
24 fp, err := os.OpenFile(this.path, os.O_CREATE|os.O_WRONLY, 0666)
25 if err != nil {
26 return false, err
27 }
28 this.fp = fp
29 }
30 return this.tryLock()
31}
32
33func (this *Locker) Lock() error {
34 if this.fp == nil {

Callers 1

ApplyMethod · 0.45

Calls 1

tryLockMethod · 0.95

Tested by

no test coverage detected