Тема: locking
-
Preventing concurrent runs of an admin script: flock, lockf and a named mutex on Windows
A scheduled or agent-triggered admin script that can be started again before the previous run finished needs a lock, not a hope that it never happens. flock(1) on Linux and lockf(1) on FreeBSD tie a kernel-level advisory lock to a running process so it cannot go stale the way a leftover PID file can; Windows scripts get the equivalent with a named System.Threading.Mutex.
Машиночитаемо: JSON