Locks are handled by the OS. Therefore:
- If a process crashes, all locks that it holds are released (along with any other resource that it holds)
- if the system fails, the locks do not make sense, since they are not transferred to the next reboot.
PHP should not do anything special except use the file locking mechanism provided by the OS, so in general you are completely safe.
, - , , ( ), , -. , , , ( : - - " ", ).