返回 DeepSeek-Reasonix
filelock_unix.go
根目录 / internal / taskmonitor / filelock_unix.go
1 //go:build !windows
2
3 package taskmonitor
4
5 import (
6 "os"
7
8 "golang.org/x/sys/unix"
9 )
10
11 func lockTaskFile(f *os.File) error { return unix.Flock(int(f.Fd()), unix.LOCK_EX) }
12
13 func unlockTaskFile(f *os.File) error { return unix.Flock(int(f.Fd()), unix.LOCK_UN) }
14
14 lines GO