Lock files are used to prevent Race Conditions, a situation that occurs when two processes that share/change the same resources run at the same time and can cause unexpected effects.
Programs will implement lock files in their own way, which usually will prevent you from running or opening a second instance of the file, or forces the second instance to be in a read only mode to prevent both instances altering the source.
Most Microsoft Office files create a hidden lock file in the same location of the source file (unless the file is set up for sharing), and will cause a message to show as follows:
These options allow you to open a file as read only, or to show a message once the lock file has been removed.
The program itself will implement and handle lock files in it's own way, so the behaviour, although typically like this, may implement different methods of handling lock files.
More information: File Locking, Lock (Computer Science) and, to some extent, Mutual Exclusion (Mutex)
I have put also the contents of the .lockfile, but why arent they visible here ?! – Farzad64 – 2016-02-06T08:39:26.830