mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2026-02-06 00:35:50 +08:00
阶段性提交
This commit is contained in:
21
internal/configs/serverconfigs/shared/locker.go
Normal file
21
internal/configs/serverconfigs/shared/locker.go
Normal file
@@ -0,0 +1,21 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user