Files
EdgeCommon/pkg/serverconfigs/shared/locker.go

22 lines
265 B
Go
Raw Permalink Normal View History

2020-09-13 19:27:47 +08:00
package shared
import (
"sync"
)
var Locker = new(FileLocker)
// global file modify locker
type FileLocker struct {
locker sync.Mutex
}
// lock
func (this *FileLocker) Lock() {
this.locker.Lock()
}
func (this *FileLocker) Unlock() {
this.locker.Unlock()
}